summaryrefslogtreecommitdiffstats
path: root/import-layers/yocto-poky/meta/recipes-devtools
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2016-08-17 14:31:25 -0500
committerPatrick Williams <patrick@stwcx.xyz>2016-08-22 16:43:26 +0000
commit60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch)
treeecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers/yocto-poky/meta/recipes-devtools
parente18c61205e0234b03697129c20cc69c9b3940efc (diff)
downloadtalos-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.gz
talos-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.zip
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to hold all of the layers that we import with git-subtree. Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-devtools')
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native.inc70
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt-package.inc78
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt.inc31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch378
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-environment.mak-musl-based-systems-can-generate-shar.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch160
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-test.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch12
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/makerace.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/noconfigure.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/nodoc.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/truncate-filename.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt/use-host.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/apt_1.0.10.1.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/files/apt.conf42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/files/db_linking_hack.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/files/environment.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/apt/files/no-curl.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf.inc44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch136
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/config_site.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch120
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/performance.patch60
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/preferbash.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.6.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/increase-timeout-limit.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/redirect-output-dir.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake.inc21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake/buildtest.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake/new_rt_path_for_test-driver.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake/performance.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake/python-libdir.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.26.inc42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.26.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross.inc30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross_2.26.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.26.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils.inc162
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-Generate-relocatable-SDKs.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0002-configure-widen-the-regexp-for-SH-architectures.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0003-Point-scripts-location-to-libdir.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0005-Explicitly-link-with-libm-on-uclibc.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch21295
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch273
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch413
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-Fix-GOT-address-computations-in-initial-PLT-entries-.patch72
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-Correct-nios2-_gp-address-computation.patch106
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils_2.26.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison/bison-2.3_m4.patch591
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison/dont-depend-on-help2man.patch.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison/m4.patch414
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison_2.3.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bison/bison_3.0.4.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb155
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-parallel.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-symlink-creation-multiple-times.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.4.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/build-compare/build-compare_git.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/Rename-rpm-check.sh-to-pkg-diff.sh.patch1599
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache.inc18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.2.4.bb10
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ccache/files/0002-dev.mk.in-fix-file-name-too-long.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath_0.16.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.4.3.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake.inc55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/0001-Add-NIOS2-CPU-support.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch77
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.4.3.bb53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.22.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config/distcc.sh4
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root/exports1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat/run-ptest5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/distcc/distcc_3.1.bb74
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/distcc/files/0001-zeroconf-Include-fcntl.h.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/distcc/files/default24
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc119
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc.service11
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop12
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/distcc/files/separatebuilddir.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dmidecode/dmidecode_3.0.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb71
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-3.1-native_3.1.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.1-native_4.1.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.5-native.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc70
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/files/LICENSE-OASIS16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-0.6.14/re.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/LICENSE-OASIS16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml-update-catalog.xml.patch515
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml68
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml6
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.78.1.bb74
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-Include-fcntl.h-for-getting-loff_t-definition.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-mkfs.fat-fix-incorrect-int-type.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/fix_populated_dosfs_creation.patch489
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/largefile.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch241
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch639
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_3.0.28.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg.inc79
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch60
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch86
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/noman.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.4.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/acinclude.m4135
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch67
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest11
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/xattr_ordering.patch219
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_git.bb111
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff449
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff71
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_begin.c-CVE-2014-9447-fix.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff801
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/i386_dis.h1657
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff309
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff713
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff756
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff1709
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch154
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support-for-elfutils-0.148.patch91
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/x86_64_dis.h1632
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-Ignore-differences-between-mips-machine-identifiers.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch1163
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-fix-a-stack-usage-warning.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-remove-the-unneed-checking.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch168
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0003-Add-mips-n64-relocation-format-hack.patch226
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/aarch64_uio.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/arm_backend.diff600
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/fixheadercheck.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/hppa_backend.diff799
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/kfreebsd_path.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/m68k_backend.diff492
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_backend.diff711
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_readelf_w.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/shadow.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/testsuite-ignore-elflint.diff39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/uclibc-support.patch129
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/dso-link-change.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb90
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.164.bb89
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-configure.in.patch108
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-expect-install-scripts-without-using-the-fixline1-tc.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/expect/expect/01-example-shebang.patch144
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/expect/expect_5.45.bb64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.1.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/file/file/debian-742262.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/file/file/host-file.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/file/file_5.25.bb47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/flex/flex/disable-tests.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch17
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/flex/flex/run-ptest5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/flex/flex_2.6.0.bb55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9.inc139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0002-uclibc-conf.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch87
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0004-uclibc-locale.patch2862
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0005-uclibc-locale-no__x.patch257
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0006-uclibc-locale-wchar_fix.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0007-uclibc-locale-update.patch542
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0008-missing-execinfo_h.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0009-c99-snprintf.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0010-c99-complex-ugly-hack.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0011-index_macro.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0013-libstdc-namespace.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0014-sh-pr24836.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0016-gcc-poison-system-directories.patch190
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0017-gcc-poison-dir-extend.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0019-64-bit-multilib-hack.patch82
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0020-optional-libstdc.patch98
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0022-COLLECT_GCC_OPTIONS.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch96
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0025-fortran-cross-compile-hack.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0026-libgcc-sjlj-check.patch74
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0027-cpp-honor-sysroot.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0028-MIPS64-Default-to-N64-ABI.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch228
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0030-gcc-Fix-argument-list-too-long-error.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0031-Disable-sdt.patch113
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0032-libtool.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0040-fix-g++-sysroot.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0041-libtool-avoid-libdir.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0043-cpp.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0044-gengtypes.patch97
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0046-libatomic-deptracking.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0047-repomembug.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch80
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0051-eabispe.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch138
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch66
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch148
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch75
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch113
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch81
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0063-nativesdk-gcc-support.patch198
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0064-handle-target-sysroot-multilib.patch88
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0065-gcc-483-universal-initializer-no-warning.patch107
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0066-cxxflags-for-build.patch123
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-fix-arm-thumb.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-gcc-musl-support.patch267
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0068-musl-dynamic-linker.patch205
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0069-musl-no-fixincludes.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0070-libstdc-musl.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch284
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0074-fdebug-prefix-map-support-to-remap-relative-path.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3.inc143
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0002-uclibc-conf.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0003-gcc-uclibc-locale-ctype_touplow_t.patch87
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0004-uclibc-locale.patch2862
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0005-uclibc-locale-no__x.patch257
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0006-uclibc-locale-wchar_fix.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0007-uclibc-locale-update.patch542
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0008-missing-execinfo_h.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0009-c99-snprintf.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0010-gcc-poison-system-directories.patch192
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0011-gcc-poison-dir-extend.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0013-64-bit-multilib-hack.patch85
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0014-optional-libstdc.patch101
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0016-COLLECT_GCC_OPTIONS.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch96
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0018-fortran-cross-compile-hack.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0019-libgcc-sjlj-check.patch74
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0020-cpp-honor-sysroot.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0021-MIPS64-Default-to-N64-ABI.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch216
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0023-gcc-Fix-argument-list-too-long-error.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0024-Disable-sdt.patch113
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0025-libtool.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0029-export-CPP.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0032-Ensure-target-gcc-headers-can-be-included.patch98
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0035-Dont-link-the-plugins-with-libgomp-explicitly.patch83
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0037-aarch64-Add-support-for-musl-ldso.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0038-fix-g-sysroot.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0040-handle-sysroot-support-for-nativesdk-gcc.patch213
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0041-Search-target-sysroot-gcc-version-specific-dirs-with.patch102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0042-Fix-various-_FOR_BUILD-and-related-variables.patch137
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0043-libstdc-Support-musl.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch270
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0045-Support-for-arm-linux-musl.patch216
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0047-nios2-Define-MUSL_DYNAMIC_LINKER.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0048-ssp_nonshared.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0049-Disable-the-weak-reference-logic-in-gthr.h-for-os-ge.patch78
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0050-powerpc-pass-secure-plt-to-the-linker.patch66
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0052-nios2-use-ret-with-r31.patch103
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch307
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch284
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch85
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0057-unwind-fix-for-musl.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0058-fdebug-prefix-map-support-to-remap-relative-path.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-common.inc105
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-configure-common.inc122
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian.inc172
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_4.9.bb5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_5.3.bb5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc100
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_4.9.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_5.3.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross.inc197
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_4.9.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_5.3.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc10
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.9.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_5.3.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk.inc12
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_4.9.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_5.3.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-multilib-config.inc235
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime.inc196
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_4.9.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_5.3.bb7
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc110
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_5.3.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-shared-source.inc11
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source.inc32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_4.9.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_5.3.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-target.inc210
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_4.9.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_5.3.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc145
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial.inc19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_4.9.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc.inc32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_4.9.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_5.3.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran.inc75
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_4.9.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_5.3.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.10.1.inc9
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc72
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.10.1.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross.inc29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.10.1.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb.inc18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of-SIGRTMIN.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-mips-linux-nat-Define-_ABIO32-if-not-defined.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-use-asm-sgidefs.h.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0002-Change-order-of-CFLAGS.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0003-Add-support-for-Renesas-SH-sh4-architecture.patch921
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/force-readline-static.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.10.1.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/git/git.inc127
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/git/git_2.7.4.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch170
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in267
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/0001-libguile-Check-for-strtol_l-during-configure.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/0002-Recognize-nios2-as-compilation-target.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_aarch64.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_endianness.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/guile_2.0.6_fix_sed_error.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-Makefile.am-hook.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-64bit.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-turn-off-gc-test.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/remove_strcase_l_funcs.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/files/workaround-ice-ssa-corruption.patch60
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.11.bb128
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guilt/files/guilt-bash.patch288
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/guilt/guilt-native_git.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/help2man/help2man-native_1.47.3.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/files/Module.mk72
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.2.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb36
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env192
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool.inc30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/noperlcheck.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/remove-xml-check.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/use-nativeperl.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c_0.12.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc48
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/0001-libtool-Fix-support-for-NIOS2-processor.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-rpath.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fixinstall.patch102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/norm-rpath.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/prefix.patch98
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch166
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/trailingslash.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch179
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools-native_0.9.69.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_dvips_doc.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_sgml2rtf.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_tex_doc.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_txt_doc.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.17.inc18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.9.inc13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4-native_1.4.17.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4.inc10
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4/ac_config_links.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4/fix_for_circular_dependency.patch77
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4/remove-gets.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.17.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.9.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/make_fix_for_automake-1.12.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/makeinfo.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/make/make-4.1/0001-main.c-main-SV-43434-Handle-NULL-returns-from-ttynam.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/make/make.inc12
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/make/make_3.81.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/make/make_4.1.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/COPYING.patch346
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/makedevs.c589
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/ac_init_fix.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch81
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mmc/mmc-utils_git.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch103
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch137
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/fix-broken-lz.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools.patch129
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.gplv3.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_3.9.9.bb53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_4.0.18.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/nasm/nasm_2.11.08.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/fix-regex.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/makefile.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/msggen.pl.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/no-libtool.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/reautoconf.patch83
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/user-declared-default-constructor.patch92
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb121
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp-1.5.2/obsolete_automake_macros.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp_1.5.2.bb59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb48
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb48
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-configure.ac-use-pkg-config-for-libsolv.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg.conf28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.1.bb75
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/orc/orc_0.4.24.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0001-Change-library-name.patch119
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0004-fix-data-uuid-from-string.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch.inc14
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch/debian.patch10426
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch/global-reject-file.diff203
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch/install.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch/unified-reject-files.diff307
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.5.9.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.7.5.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf/maxsize.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf_0.8.bb13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.1.5.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/liberror-perl_0.17024.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/liburi-perl_1.60.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-perl_0.08.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-simple-perl_2.22.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl-native_5.22.1.bb127
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl-ptest.inc37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl-rdepends_5.22.1.inc2562
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl.inc10
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Configure-multilib.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch375
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh1221
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-3238
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-be1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-le1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-6438
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-be1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-le1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff62
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/doc_info.diff35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff70
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fakeroot.diff42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/find_html2text.diff35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff110
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff73
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff170
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff109
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff86
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff153
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/mod_paths.diff99
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff92
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/patchlevel.diff30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perlivp.diff39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff118
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/regen-skip.diff27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/generate-sh.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/installperl.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-nopacklist.patch91
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-perlinc.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-PathTools-don-t-filter-out-blib-from-INC.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch47
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configure.sh43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-dynloader.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-enable-gdbm.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-errno-generation-gcc5.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-moreconfig.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/test/dist-threads-t-join.t-adjust-ps-option.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl_5.22.1.bb367
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in7
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/postinst-intercept/nativesdk-postinst-intercept_1.0.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/macros.prelink5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.conf18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.cron.daily40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.default22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink_git.bb81
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-group2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/handle-remove-xattr.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/moreretries.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo.inc134
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc288
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc264
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-async_0.6.2.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-dbus_1.2.0.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-docutils_0.12.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-git_1.0.2.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-gitdb_0.6.4.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging_1.1.7.bb45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-mako_1.0.3.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/avoid_parallel_make_races_on_pgen.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/debug.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/multilib.patch235
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/nohostlibs.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch86
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native/unixccompiler.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.11.bb63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-nose_1.3.7.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch78
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/add-glibc-check.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/config.h21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/config.h21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/config.h21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/remove-build-path-in-comments.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/config.h139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86/config.h108
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86/numpyconfig.h24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy_1.10.4.bb102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pexpect_4.0.1.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pycairo_1.10.0.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl/no-static-link.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl_7.21.5.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject/0001-configure.ac-add-sysroot-path-to-GI_DATADIR-don-t-se.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject_3.18.2.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex_0.9.9.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-scons-native_2.4.1.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.4.1.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools.inc21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools_19.4.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch158
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch177
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch91
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch381
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm_git.bb137
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-smmap_0.9.0.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python.inc32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch97
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/add-md5module-support.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_parallel_make_races_on_pgen.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/builddir.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/cgi_py.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch77
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/host_include_contamination.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/multilib.patch296
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/run-ptest5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/setuptweaks.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/sitecustomize.py45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.1.bb79
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_8.0.0.bb48
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3-setuptools_19.4.bb37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/000-cross-compile.patch85
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch92
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/110-enable-zlib.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch88
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/130-readline-setup.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/cgi_py.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/host_include_contamination.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch312
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-config.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/setuptweaks.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/sitecustomize.py37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/unixccompiler.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3/use_packed_importlib.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3_3.5.1.bb226
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python_2.7.11.bb173
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c370
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/tunctl.c156
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-targets.inc22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc135
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-1568.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2198.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/configure-fix-Darwin-target-detection.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch76
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch72
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch93
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch84
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/no-valgrind.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/pathlimit.patch137
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/powerpc_rom.binbin0 -> 4096 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/run-ptest8
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/wacom.patch130
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.5.0.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native.inc18
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native_0.64.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt.inc64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/Makefile13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/aclocal.patch128
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/install.patch13
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/run-ptest8
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/test.sh1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt_0.64.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/remake/remake.inc16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/remake/remake/version-remake.texi.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/remake/remake_4.1+dbg-1.1.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-Disable-__sync_add_and_fetch_8-on-nios2.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-define-EM_AARCH64.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch294
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/configure.ac-check-for-both-gpg2-and-gpg.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/dbconvert.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch100
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/header-include-fix.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch14
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/popt-disable-auto-stack-protector.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch31
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/pythondeps.sh16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-atomic-ops.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen-force.patch78
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch136
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-check-rootpath-reasonableness.patch96
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch174
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db60.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch77
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-auto-stack-protector.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-blaketest.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-lua-tests-compilation-failure.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-parseEmbedded.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-gnu-atomic.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-keccak-sse-intrin.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lua.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.in-disable-external-key-server.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-mongodb-sasl.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch126
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform.patch137
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch105
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-AddErase.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-restore-origin.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-tagname.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmdb-grammar.patch124
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmfc.c-fix-for-N32-MIPS64.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmio-headers.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-popt.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch159
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-syck-fix-gram.patch1081
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tagname-type.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch40
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm2cpio39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmatch.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch194
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv.c-check-_gpg_passphrase-before-ask-for-input.patch70
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/uclibc-support.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb730
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb740
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c426
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve_1.0.bb29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/files/makefile-no-rebuild.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/files/rsyncd.conf15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsync-2.6.9-fname-obo.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf15
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync.inc23
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_2.6.9.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_3.1.2.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby.inc38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/extmk.patch13
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.2.2.bb46
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts92
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service16
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/autohell.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/license.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb71
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb68
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/sgmlspl/sgmlspl-native_git.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch154
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch176
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch117
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch198
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch306
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch46
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/strace/strace/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch118
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/use-asm-sgidefs.h.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace_4.11.bb51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-Fix-libtool-name-in-configure.ac.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/disable_macos.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/serf.m4-Regex-modified-to-allow-D-in-paths.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.3.bb53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/swabber/swabber-native_git.bb21
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/swig/swig.inc63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/swig/swig_3.0.8.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch84
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch141
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch116
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch91
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch127
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch215
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch84
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch427
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0010-gcc46-compatibility.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0011-mk-MMD-does-not-take-any-arguments.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb89
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/0001-canonicalize_file_name-is-specific-to-glibc.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/ldflags.patch28
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init75
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service10
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb52
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch76
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/no_packages.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/run-ptest8
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl_8.6.4.bb102
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch158
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch74
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/vala/vala.inc51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.30.1.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-fix-build-for-musl-targets.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0002-remove-rpath.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch175
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch252
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch96
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch53
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/run-ptest12
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb118
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/xmlto/files/catalog.xml19
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto-0.0.28/configure.in-drop-the-test-of-xmllint-and-xsltproc.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb20
1013 files changed, 118970 insertions, 0 deletions
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
new file mode 100644
index 000000000..27cc9ff0b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native.inc
@@ -0,0 +1,70 @@
+require apt.inc
+inherit native
+
+DEPENDS += "dpkg-native gettext-native db-native curl-native xz-native"
+PACKAGES = ""
+USE_NLS = "yes"
+
+SRC_URI += "file://db_linking_hack.patch \
+ file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
+ file://0001-remove-Wsuggest-attribute-from-CFLAGS.patch \
+ file://0001-fix-the-gcc-version-check.patch \
+"
+
+python do_install () {
+ bb.build.exec_func('do_install_base', d)
+ bb.build.exec_func('do_install_config', d)
+}
+
+python do_install_config () {
+ indir = os.path.dirname(d.getVar('FILE',1))
+ infile = file(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')
+ if not os.path.exists(outdir):
+ os.makedirs(outdir)
+
+ outpath = oe.path.join(outdir, 'apt.conf.sample')
+ if not os.path.exists(outpath):
+ outfile = file(outpath, 'w')
+ outfile.write(data)
+ outfile.close()
+}
+
+do_install_base () {
+ install -d ${D}${bindir}
+ install -m 0755 bin/apt-cdrom ${D}${bindir}/
+ install -m 0755 bin/apt-get ${D}${bindir}/
+ install -m 0755 bin/apt-config ${D}${bindir}/
+ install -m 0755 bin/apt-cache ${D}${bindir}/
+ install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
+ install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
+ install -m 0755 bin/apt-ftparchive ${D}${bindir}/
+
+ oe_libinstall -so -C bin libapt-private ${D}${libdir}/
+
+ oe_libinstall -so -C bin libapt-pkg$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
+ oe_libinstall -so -C bin libapt-inst$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
+
+ install -d ${D}${libdir}/apt/methods
+ install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
+
+ install -d ${D}${libdir}/dpkg/methods/apt
+ install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/
+ install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/
+ install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/
+ install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/
+ install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/
+
+ install -d ${D}${sysconfdir}/apt
+ install -d ${D}${sysconfdir}/apt/apt.conf.d
+ install -d ${D}${sysconfdir}/apt/preferences.d
+ install -d ${D}${localstatedir}/lib/apt/lists/partial
+ install -d ${D}${localstatedir}/cache/apt/archives/partial
+
+ install -d ${D}${localstatedir}/log/apt/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb
new file mode 100644
index 000000000..1e660da74
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb
@@ -0,0 +1,4 @@
+require apt-native.inc
+
+SRC_URI += "file://noconfigure.patch \
+ file://no-curl.patch"
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
new file mode 100644
index 000000000..a553aa21f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt-package.inc
@@ -0,0 +1,78 @@
+apt-manpages="doc/apt-cache.8 \
+ doc/apt-cdrom.8 \
+ doc/apt-config.8 \
+ doc/apt-get.8 \
+ doc/apt.8 \
+ doc/apt.conf.5 \
+ doc/apt_preferences.5 \
+ doc/sources.list.5"
+apt-utils-manpages="doc/apt-extracttemplates.1 \
+ doc/apt-sortpkgs.1"
+
+def get_files_apt_doc(d, bb, manpages):
+ import re
+ manpages = re.sub(r'\bdoc/(\S+)/(\S+)\.\1\.(.)\b', r'${mandir}/\1/man\3/\2.\3', manpages)
+ manpages = re.sub(r'\bdoc/(\S+)\.(.)\b', r'${mandir}/man\2/\1.\2', manpages)
+ return manpages
+
+def get_commands_apt_doc(d, bb, manpages):
+ s = list()
+ __dir_cache__ = list()
+ for m in manpages.split():
+ dest = get_files_apt_doc(d, bb, m)
+ dir = os.path.dirname(dest)
+ if not dir in __dir_cache__:
+ s.append("install -d ${D}/%s" % dir)
+ __dir_cache__.append(dir)
+ s.append("install -m 0644 %s ${D}/%s" % (m, dest))
+ return "\n".join(s)
+
+PACKAGES += "${PN}-utils ${PN}-utils-doc"
+FILES_${PN} = "${bindir}/apt-cdrom ${bindir}/apt-get \
+ ${bindir}/apt-config ${bindir}/apt-cache \
+ ${libdir}/apt ${libdir}/libapt*.so.* \
+ ${localstatedir} ${sysconfdir} \
+ ${libdir}/dpkg"
+FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
+FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages', True))} \
+ ${docdir}/apt"
+FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages', True))}"
+FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
+
+do_install () {
+ set -x
+ install -d ${D}${bindir}
+ install -m 0755 bin/apt-key ${D}${bindir}/
+ install -m 0755 bin/apt-cdrom ${D}${bindir}/
+ install -m 0755 bin/apt-get ${D}${bindir}/
+ install -m 0755 bin/apt-config ${D}${bindir}/
+ install -m 0755 bin/apt-cache ${D}${bindir}/
+
+ install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
+ install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
+
+ oe_libinstall -so -C bin libapt-pkg ${D}${libdir}
+ oe_libinstall -so -C bin libapt-inst ${D}${libdir}
+
+ install -d ${D}${libdir}/apt/methods
+ install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
+
+ install -d ${D}${libdir}/dpkg/methods/apt
+ install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/
+ install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/
+ install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/
+ install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/
+ install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/
+
+ install -d ${D}${sysconfdir}/apt
+ install -d ${D}${sysconfdir}/apt/apt.conf.d
+ install -d ${D}${sysconfdir}/apt/sources.list.d
+ install -d ${D}${sysconfdir}/apt/preferences.d
+ install -d ${D}${localstatedir}/lib/apt/lists/partial
+ install -d ${D}${localstatedir}/cache/apt/archives/partial
+ install -d ${D}${docdir}/apt/examples
+ install -m 0644 ${S}/doc/examples/* ${D}${docdir}/apt/examples/
+
+ install -d ${D}${includedir}/apt-pkg/
+ install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt.inc b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt.inc
new file mode 100644
index 000000000..78ef5a7e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt.inc
@@ -0,0 +1,31 @@
+SUMMARY = "Advanced front-end for dpkg"
+LICENSE = "GPLv2.0+"
+SECTION = "base"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20150805T094928Z/pool/main/a/${BPN}/${BPN}_${PV}.tar.xz \
+ file://use-host.patch \
+ file://makerace.patch \
+ file://no-nls-dpkg.patch \
+ file://fix-gcc-4.6-null-not-defined.patch \
+ file://truncate-filename.patch \
+ file://nodoc.patch \
+ file://disable-configure-in-makefile.patch \
+ file://disable-test.patch \
+ file://0001-environment.mak-musl-based-systems-can-generate-shar.patch \
+ "
+SRC_URI[md5sum] = "6505c4297b338adb2087ce87bbc4a276"
+SRC_URI[sha256sum] = "3fb1de9598363c416591d49e3c285458e095b035e6c06d5b944a54e15fc9b543"
+LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+# 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/a/apt/"
+
+inherit autotools gettext
+
+EXTRA_AUTORECONF = "--exclude=autopoint,autoheader"
+
+do_configure_prepend() {
+ rm -rf ${S}/buildlib/config.sub
+ rm -rf ${S}/buildlib/config.guess
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
new file mode 100644
index 000000000..d33069b73
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
@@ -0,0 +1,378 @@
+From 106797f1c66fa578dad21fd9380bf9d576573dfd Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Fri, 22 May 2015 08:05:15 +0800
+Subject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our
+ dpkg callings"
+
+Upstream-Status: Inappropriate [embedded specific]
+
+This reverts commit a2a75ff4516f7609f4c55b42270abb8d08943c60, which
+always run 'dpkg --configure -a' at the end of our dpkg callings,
+but it does not work for cross-compile, since the rootfs dir can not
+be passed into dpkg, and lead to the below similar error:
+ -------
+ |mkdir: cannot create directory '/usr/lib/opkg': Permission denied
+ -------
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ apt-pkg/deb/dpkgpm.cc | 9 +--
+ test/integration/framework | 25 ++++----
+ test/integration/test-apt-progress-fd | 67 +++++++++----------
+ test/integration/test-apt-progress-fd-deb822 | 18 ++----
+ test/integration/test-apt-progress-fd-error | 2 +-
+ ...est-bug-769609-triggers-still-pending-after-run | 75 ----------------------
+ .../test-no-fds-leaked-to-maintainer-scripts | 6 +-
+ 7 files changed, 56 insertions(+), 146 deletions(-)
+ delete mode 100755 test/integration/test-bug-769609-triggers-still-pending-after-run
+
+diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
+index b187efb..f269764 100644
+--- a/apt-pkg/deb/dpkgpm.cc
++++ b/apt-pkg/deb/dpkgpm.cc
+@@ -1049,12 +1049,6 @@ void pkgDPkgPM::BuildPackagesProgressMap()
+ PackagesTotal++;
+ }
+ }
+- /* one extra: We don't want the progress bar to reach 100%, especially not
+- if we call dpkg --configure --pending and process a bunch of triggers
+- while showing 100%. Also, spindown takes a while, so never reaching 100%
+- is way more correct than reaching 100% while still doing stuff even if
+- doing it this way is slightly bending the rules */
+- ++PackagesTotal;
+ }
+ /*}}}*/
+ #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR < 13)
+@@ -1294,8 +1288,9 @@ bool pkgDPkgPM::GoNoABIBreak(APT::Progress::PackageManager *progress)
+
+ // support subpressing of triggers processing for special
+ // cases like d-i that runs the triggers handling manually
++ bool const SmartConf = (_config->Find("PackageManager::Configure", "all") != "all");
+ bool const TriggersPending = _config->FindB("DPkg::TriggersPending", false);
+- if (_config->FindB("DPkg::ConfigurePending", true) == true)
++ if (_config->FindB("DPkg::ConfigurePending", SmartConf) == true)
+ List.push_back(Item(Item::ConfigurePending, PkgIterator()));
+
+ // for the progress
+diff --git a/test/integration/framework b/test/integration/framework
+index 70ad381..00672ad 100644
+--- a/test/integration/framework
++++ b/test/integration/framework
+@@ -1178,13 +1178,10 @@ testnopackage() {
+ fi
+ }
+
+-testdpkgstatus() {
+- local STATE="$1"
+- local NR="$2"
+- shift 2
+- msgtest "Test that $NR package(s) are in state $STATE with" "dpkg -l $*"
+- local PKGS="$(dpkg -l "$@" 2>/dev/null | grep "^${STATE}" | wc -l)"
+- if [ "$PKGS" != $NR ]; then
++testdpkginstalled() {
++ msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
++ local PKGS="$(dpkg -l "$@" 2>/dev/null | grep '^i' | wc -l)"
++ if [ "$PKGS" != $# ]; then
+ echo >&2 $PKGS
+ dpkg -l "$@" | grep '^[a-z]' >&2
+ msgfail
+@@ -1193,12 +1190,16 @@ testdpkgstatus() {
+ fi
+ }
+
+-testdpkginstalled() {
+- testdpkgstatus 'ii' "$#" "$@"
+-}
+-
+ testdpkgnotinstalled() {
+- testdpkgstatus 'ii' '0' "$@"
++ msgtest "Test for correctly not-installed package(s) with" "dpkg -l $*"
++ local PKGS="$(dpkg -l "$@" 2> /dev/null | grep '^i' | wc -l)"
++ if [ "$PKGS" != 0 ]; then
++ echo
++ dpkg -l "$@" | grep '^[a-z]' >&2
++ msgfail
++ else
++ msgpass
++ fi
+ }
+
+ testmarkedauto() {
+diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd
+index 68cc043..d72e7e7 100755
+--- a/test/integration/test-apt-progress-fd
++++ b/test/integration/test-apt-progress-fd
+@@ -19,14 +19,13 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Installing testing (amd64)
+-pmstatus:testing:16.6667:Preparing testing (amd64)
+-pmstatus:testing:33.3333:Unpacking testing (amd64)
+-pmstatus:testing:50:Preparing to configure testing (amd64)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing:50:Configuring testing (amd64)
+-pmstatus:testing:66.6667:Configuring testing (amd64)
+-pmstatus:testing:83.3333:Installed testing (amd64)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing:20:Preparing testing (amd64)
++pmstatus:testing:40:Unpacking testing (amd64)
++pmstatus:testing:60:Preparing to configure testing (amd64)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing:60:Configuring testing (amd64)
++pmstatus:testing:80:Configuring testing (amd64)
++pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
+
+ # upgrade
+ exec 3> apt-progress.log
+@@ -35,14 +34,13 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Installing testing (amd64)
+-pmstatus:testing:16.6667:Preparing testing (amd64)
+-pmstatus:testing:33.3333:Unpacking testing (amd64)
+-pmstatus:testing:50:Preparing to configure testing (amd64)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing:50:Configuring testing (amd64)
+-pmstatus:testing:66.6667:Configuring testing (amd64)
+-pmstatus:testing:83.3333:Installed testing (amd64)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing:20:Preparing testing (amd64)
++pmstatus:testing:40:Unpacking testing (amd64)
++pmstatus:testing:60:Preparing to configure testing (amd64)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing:60:Configuring testing (amd64)
++pmstatus:testing:80:Configuring testing (amd64)
++pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
+
+ # reinstall
+ exec 3> apt-progress.log
+@@ -51,24 +49,22 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Installing testing (amd64)
+-pmstatus:testing:16.6667:Preparing testing (amd64)
+-pmstatus:testing:33.3333:Unpacking testing (amd64)
+-pmstatus:testing:50:Preparing to configure testing (amd64)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing:50:Configuring testing (amd64)
+-pmstatus:testing:66.6667:Configuring testing (amd64)
+-pmstatus:testing:83.3333:Installed testing (amd64)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing:20:Preparing testing (amd64)
++pmstatus:testing:40:Unpacking testing (amd64)
++pmstatus:testing:60:Preparing to configure testing (amd64)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing:60:Configuring testing (amd64)
++pmstatus:testing:80:Configuring testing (amd64)
++pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
+
+ # and remove
+ exec 3> apt-progress.log
+ testsuccess aptget remove testing -y -o APT::Status-Fd=3
+ testequal "pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Removing testing (amd64)
+-pmstatus:testing:25:Preparing for removal of testing (amd64)
+-pmstatus:testing:50:Removing testing (amd64)
+-pmstatus:testing:75:Removed testing (amd64)
+-pmstatus:dpkg-exec:75:Running dpkg" cat apt-progress.log
++pmstatus:testing:33.3333:Preparing for removal of testing (amd64)
++pmstatus:testing:66.6667:Removing testing (amd64)
++pmstatus:testing:100:Removed testing (amd64)" cat apt-progress.log
+
+ # install non-native and ensure we get proper progress info
+ exec 3> apt-progress.log
+@@ -79,13 +75,12 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing2:0:Installing testing2 (i386)
+-pmstatus:testing2:16.6667:Preparing testing2 (i386)
+-pmstatus:testing2:33.3333:Unpacking testing2 (i386)
+-pmstatus:testing2:50:Preparing to configure testing2 (i386)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing2:50:Configuring testing2 (i386)
+-pmstatus:testing2:66.6667:Configuring testing2 (i386)
+-pmstatus:testing2:83.3333:Installed testing2 (i386)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing2:20:Preparing testing2 (i386)
++pmstatus:testing2:40:Unpacking testing2 (i386)
++pmstatus:testing2:60:Preparing to configure testing2 (i386)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing2:60:Configuring testing2 (i386)
++pmstatus:testing2:80:Configuring testing2 (i386)
++pmstatus:testing2:100:Installed testing2 (i386)" cat apt-progress.log
+
+ rm -f apt-progress*.log
+diff --git a/test/integration/test-apt-progress-fd-deb822 b/test/integration/test-apt-progress-fd-deb822
+index badc985..9d22794 100755
+--- a/test/integration/test-apt-progress-fd-deb822
++++ b/test/integration/test-apt-progress-fd-deb822
+@@ -27,41 +27,37 @@ Message: Installing testing (amd64)
+
+ Status: progress
+ Package: testing:amd64
+-Percent: 16.6667
++Percent: 20
+ Message: Preparing testing (amd64)
+
+ Status: progress
+ Package: testing:amd64
+-Percent: 33.3333
++Percent: 40
+ Message: Unpacking testing (amd64)
+
+ Status: progress
+ Package: testing:amd64
+-Percent: 50
++Percent: 60
+ Message: Preparing to configure testing (amd64)
+
+ Status: progress
+-Percent: 50
++Percent: 60
+ Message: Running dpkg
+
+ Status: progress
+ Package: testing:amd64
+-Percent: 50
++Percent: 60
+ Message: Configuring testing (amd64)
+
+ Status: progress
+ Package: testing:amd64
+-Percent: 66.6667
++Percent: 80
+ Message: Configuring testing (amd64)
+
+ Status: progress
+ Package: testing:amd64
+-Percent: 83.3333
++Percent: 100
+ Message: Installed testing (amd64)
+-
+-Status: progress
+-Percent: 83.3333
+-Message: Running dpkg
+ " cat apt-progress.log
+
+
+diff --git a/test/integration/test-apt-progress-fd-error b/test/integration/test-apt-progress-fd-error
+index 6323007..a47095b 100755
+--- a/test/integration/test-apt-progress-fd-error
++++ b/test/integration/test-apt-progress-fd-error
+@@ -18,7 +18,7 @@ setupaptarchive
+ exec 3> apt-progress.log
+ testfailure aptget install foo1 foo2 -y -o APT::Status-Fd=3
+ msgtest "Ensure correct error message"
+-if grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb:36.3636:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log; then
++if grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb:40:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log; then
+ msgpass
+ else
+ cat apt-progress.log
+diff --git a/test/integration/test-bug-769609-triggers-still-pending-after-run b/test/integration/test-bug-769609-triggers-still-pending-after-run
+deleted file mode 100755
+index 146fa76..0000000
+--- a/test/integration/test-bug-769609-triggers-still-pending-after-run
++++ /dev/null
+@@ -1,75 +0,0 @@
+-#!/bin/sh
+-set -e
+-
+-TESTDIR=$(readlink -f $(dirname $0))
+-. $TESTDIR/framework
+-
+-setupenvironment
+-configarchitecture 'amd64'
+-
+-msgtest 'Check if installed dpkg supports' 'noawait trigger'
+-if dpkg-checkbuilddeps -d 'dpkg (>= 1.16.1)' /dev/null; then
+- msgpass
+-else
+- msgskip 'dpkg version too old'
+- exit 0
+-fi
+-configdpkgnoopchroot
+-
+-buildtriggerpackages() {
+- local TYPE="$1"
+- setupsimplenativepackage "triggerable-$TYPE" 'all' '1.0' 'unstable' "Depends: trigdepends-$TYPE"
+- BUILDDIR="incoming/triggerable-${TYPE}-1.0"
+- cat >${BUILDDIR}/debian/postinst <<EOF
+-#!/bin/sh
+-if [ "\$1" = 'triggered' ]; then
+- ls -l /proc/self/fd/
+-fi
+-EOF
+- echo "$TYPE /usr/share/doc" > ${BUILDDIR}/debian/triggers
+- buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
+- rm -rf "$BUILDDIR"
+- buildsimplenativepackage "trigdepends-$TYPE" 'all' '1.0' 'unstable'
+-}
+-
+-#buildtriggerpackages 'interest'
+-buildtriggerpackages 'interest-noawait'
+-buildsimplenativepackage "trigstuff" 'all' '1.0' 'unstable'
+-
+-setupaptarchive
+-
+-runtests() {
+- local TYPE="$1"
+- msgmsg 'Working with trigger type' "$TYPE"
+- testsuccess aptget install triggerable-$TYPE -y
+- cp rootdir/tmp/testsuccess.output terminal.output
+- testsuccess grep '^REWRITE ' terminal.output
+- testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
+-
+- testsuccess aptget install trigdepends-$TYPE -y --reinstall
+- cp rootdir/tmp/testsuccess.output terminal.output
+- testsuccess grep '^REWRITE ' terminal.output
+- testsuccess grep ' root root ' terminal.output
+- testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
+-
+- testsuccess aptget install trigstuff -y
+- cp rootdir/tmp/testsuccess.output terminal.output
+- testsuccess grep '^REWRITE ' terminal.output
+- testsuccess grep ' root root ' terminal.output
+- testdpkginstalled triggerable-$TYPE trigdepends-$TYPE trigstuff
+-
+- testsuccess aptget purge trigstuff -y
+- cp rootdir/tmp/testsuccess.output terminal.output
+- testsuccess grep '^REWRITE ' terminal.output
+- testsuccess grep ' root root ' terminal.output
+- testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
+- testdpkgnotinstalled trigstuff
+-
+- testsuccess aptget purge trigdepends-$TYPE -y
+- cp rootdir/tmp/testsuccess.output terminal.output
+- testfailure grep '^REWRITE ' terminal.output
+- testfailure grep ' root root ' terminal.output
+- testdpkgnotinstalled triggerable-$TYPE trigdepends-$TYPE
+-}
+-#runtests 'interest'
+-runtests 'interest-noawait'
+diff --git a/test/integration/test-no-fds-leaked-to-maintainer-scripts b/test/integration/test-no-fds-leaked-to-maintainer-scripts
+index 41c0570..d3960d7 100755
+--- a/test/integration/test-no-fds-leaked-to-maintainer-scripts
++++ b/test/integration/test-no-fds-leaked-to-maintainer-scripts
+@@ -59,8 +59,7 @@ startup packages configure
+ configure $PKGNAME 1.0 <none>
+ status unpacked $PKGNAME 1.0
+ status half-configured $PKGNAME 1.0
+-status installed $PKGNAME 1.0
+-startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
++status installed $PKGNAME 1.0" cut -f 3- -d' ' rootdir/var/log/dpkg.log
+ }
+ checkinstall
+
+@@ -85,8 +84,7 @@ status config-files $PKGNAME 1.0
+ status config-files $PKGNAME 1.0
+ status config-files $PKGNAME 1.0
+ status config-files $PKGNAME 1.0
+-status not-installed $PKGNAME <none>
+-startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
++status not-installed $PKGNAME <none>" cut -f 3- -d' ' rootdir/var/log/dpkg.log
+ }
+ checkpurge
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-environment.mak-musl-based-systems-can-generate-shar.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-environment.mak-musl-based-systems-can-generate-shar.patch
new file mode 100644
index 000000000..042372b51
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-environment.mak-musl-based-systems-can-generate-shar.patch
@@ -0,0 +1,29 @@
+From 2f8aa21ace375c18977ed908b291c80a210a93c6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 08:06:12 +0000
+Subject: [PATCH] environment.mak: musl based systems can generate shared
+ objects too
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ buildlib/environment.mak.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in
+index b0a8d9d..3a52344 100644
+--- a/buildlib/environment.mak.in
++++ b/buildlib/environment.mak.in
+@@ -68,7 +68,7 @@ NEED_SOCKLEN_T_DEFINE = @NEED_SOCKLEN_T_DEFINE@
+
+ # Shared library things
+ HOST_OS = @host_os@
+-ifneq ($(words $(filter gnu% linux-gnu% kfreebsd-gnu% %-gnu,$(HOST_OS))),0)
++ifneq ($(words $(filter gnu% linux-gnu% kfreebsd-gnu% %-gnu linux-musl%,$(HOST_OS))),0)
+ SONAME_MAGIC=-Wl,-soname -Wl,
+ LFLAGS_SO=
+ else
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch
new file mode 100644
index 000000000..beea56d2a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch
@@ -0,0 +1,160 @@
+From 15c6ef6a827d3681ad06e862d27ab3dfb84cb687 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Wed, 27 May 2015 14:30:28 +0800
+Subject: [PATCH] fix the gcc version check
+
+Upstream-Status: pending
+
+"GCC diagnostic push" is gcc 4.6 feature, gcc 4.4.7 on centos did not know it
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ apt-pkg/cacheset.h | 4 ++--
+ apt-pkg/deb/debsrcrecords.cc | 12 ++++++------
+ apt-pkg/srcrecords.cc | 4 ++--
+ apt-pkg/srcrecords.h | 4 ++--
+ apt-pkg/vendorlist.cc | 4 ++--
+ 5 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h
+index b7229bc..8cc2917 100644
+--- a/apt-pkg/cacheset.h
++++ b/apt-pkg/cacheset.h
+@@ -119,12 +119,12 @@ public:
+ inline std::string FullName(bool const Pretty) const { return getPkg().FullName(Pretty); }
+ inline std::string FullName() const { return getPkg().FullName(); }
+ APT_DEPRECATED inline const char *Section() const {
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+ return getPkg().Section();
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+ }
+diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc
+index 49a348d..4bc9dcf 100644
+--- a/apt-pkg/deb/debsrcrecords.cc
++++ b/apt-pkg/deb/debsrcrecords.cc
+@@ -126,13 +126,13 @@ bool debSrcRecordParser::Files(std::vector<pkgSrcRecords::File> &F)
+ for (std::vector<pkgSrcRecords::File2>::const_iterator f2 = F2.begin(); f2 != F2.end(); ++f2)
+ {
+ pkgSrcRecords::File2 f;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+ f.MD5Hash = f2->MD5Hash;
+ f.Size = f2->Size;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+ f.Path = f2->Path;
+@@ -190,14 +190,14 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
+ // we have it already, store the new hash and be done
+ if (file != List.end())
+ {
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ // set for compatibility only, so warn users not us
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+ if (checksumField == "Files")
+ file->MD5Hash = hash;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+ // an error here indicates that we have two different hashes for the same file
+@@ -212,7 +212,7 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
+ F.FileSize = strtoull(size.c_str(), NULL, 10);
+ F.Hashes.push_back(hashString);
+
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ // set for compatibility only, so warn users not us
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+@@ -220,7 +220,7 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
+ F.Size = F.FileSize;
+ if (checksumField == "Files")
+ F.MD5Hash = hash;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+
+diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc
+index 3175ee7..340e796 100644
+--- a/apt-pkg/srcrecords.cc
++++ b/apt-pkg/srcrecords.cc
+@@ -160,7 +160,7 @@ bool pkgSrcRecords::Parser::Files2(std::vector<pkgSrcRecords::File2> &F2)/*{{{*/
+ for (std::vector<pkgSrcRecords::File>::const_iterator f = F.begin(); f != F.end(); ++f)
+ {
+ pkgSrcRecords::File2 f2;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+@@ -168,7 +168,7 @@ bool pkgSrcRecords::Parser::Files2(std::vector<pkgSrcRecords::File2> &F2)/*{{{*/
+ f2.Size = f->Size;
+ f2.Hashes.push_back(HashString("MD5Sum", f->MD5Hash));
+ f2.FileSize = f->Size;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+ f2.Path = f->Path;
+diff --git a/apt-pkg/srcrecords.h b/apt-pkg/srcrecords.h
+index dde22bd..91f8061 100644
+--- a/apt-pkg/srcrecords.h
++++ b/apt-pkg/srcrecords.h
+@@ -30,7 +30,7 @@ class pkgSrcRecords
+ {
+ public:
+
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ // ensure that con- & de-structor don't trigger this warning
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+@@ -48,7 +48,7 @@ class pkgSrcRecords
+ unsigned long long FileSize;
+ HashStringList Hashes;
+ };
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+
+diff --git a/apt-pkg/vendorlist.cc b/apt-pkg/vendorlist.cc
+index fb33ff1..ba1d3c3 100644
+--- a/apt-pkg/vendorlist.cc
++++ b/apt-pkg/vendorlist.cc
+@@ -11,7 +11,7 @@
+
+ #include <apti18n.h>
+
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+@@ -163,6 +163,6 @@ const Vendor* pkgVendorList::FindVendor(const std::vector<string> GPGVOutput) /*
+ }
+ /*}}}*/
+
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch
new file mode 100644
index 000000000..7c42ff07b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch
@@ -0,0 +1,43 @@
+From 2bff7ee06a4f96e7d326991d61fb86f8aa651d48 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Wed, 27 May 2015 09:48:45 +0800
+Subject: [PATCH] remove Wsuggest-attribute from CXXFLAGS
+
+Upstream-Status: Inappropriate
+
+Wsuggest-attribute is GCC 4.6 feature, centos6 is using GCC
+4.4.7 which unknown this flag, so remove it from CXXFLAGS
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ buildlib/environment.mak.in | 1 -
+ test/libapt/makefile | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in
+index b0a8d9d..91ed011 100644
+--- a/buildlib/environment.mak.in
++++ b/buildlib/environment.mak.in
+@@ -11,7 +11,6 @@ CPPFLAGS+= @CPPFLAGS@ @DEFS@ -D_REENTRANT -D_FORTIFY_SOURCE=2
+ CXX = @CXX@
+ CXXFLAGS+= @CXXFLAGS@ -Wall -Wextra
+ CXXFLAGS+= -Wcast-align -Wlogical-op -Wredundant-decls -Wmissing-declarations -Wunsafe-loop-optimizations
+-CXXFLAGS+= -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn
+ # a bit too pedantic to be run by default
+ #CXXFLAGS+= -Wpedantic -Wno-long-long -Wno-vla -Wno-variadic-macros
+ NUM_PROCS = @NUM_PROCS@
+diff --git a/test/libapt/makefile b/test/libapt/makefile
+index 7f23ace..e805f13 100644
+--- a/test/libapt/makefile
++++ b/test/libapt/makefile
+@@ -39,7 +39,6 @@ CXXFLAGS += -pthread
+ # disable some flags for gtest again
+ CXXFLAGS+= -Wno-missing-declarations
+ CXXFLAGS+= -Wno-missing-field-initializers
+-CXXFLAGS+= -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -Wno-suggest-attribute=noreturn
+
+ # All Google Test headers. Usually you shouldn't change this definition.
+ GTEST_HEADERS = /usr/include/gtest/*.h \
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch
new file mode 100644
index 000000000..7c2f64e3e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch
@@ -0,0 +1,18 @@
+Disable configure at compilation stage
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: apt-0.9.7.7/Makefile
+===================================================================
+--- apt-0.9.7.7.orig/Makefile
++++ apt-0.9.7.7/Makefile
+@@ -33,7 +33,7 @@ veryclean: clean
+ # The startup target builds the necessary configure scripts. It should
+ # be used after a CVS checkout.
+ CONVERTED=environment.mak include/config.h include/apti18n.h build/doc/Doxyfile makefile
+-include buildlib/configure.mak
++#include buildlib/configure.mak
+ $(BUILDDIR)/include/config.h: buildlib/config.h.in
+ $(BUILDDIR)/include/apti18n.h: buildlib/apti18n.h.in
+ $(BUILDDIR)/environment.mak: buildlib/environment.mak.in
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-test.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-test.patch
new file mode 100644
index 000000000..676795dc8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/disable-test.patch
@@ -0,0 +1,58 @@
+[PATCH] disable test
+
+Upstream-Status: Inappropriate [configuration]
+
+test needs gtest package, so not build the test dir
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ Makefile | 7 +++----
+ configure.ac | 6 ------
+ 2 files changed, 3 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5f5fb27..5070e96 100644
+--- a/Makefile
++++ b/Makefile
+@@ -9,8 +9,8 @@ endif
+ .PHONY: default
+ default: startup all
+
+-.PHONY: headers library clean veryclean all binary program doc test update-po
+-all headers library clean veryclean binary program doc manpages docbook test update-po startup dirs:
++.PHONY: headers library clean veryclean all binary program doc update-po
++all headers library clean veryclean binary program doc manpages docbook update-po startup dirs:
+ $(MAKE) -C vendor $@
+ $(MAKE) -C apt-pkg $@
+ $(MAKE) -C apt-inst $@
+@@ -21,9 +21,8 @@ all headers library clean veryclean binary program doc manpages docbook test upd
+ $(MAKE) -C dselect $@
+ # $(MAKE) -C doc $@
+ $(MAKE) -C po $@
+- $(MAKE) -C test $@
+
+-all headers library clean veryclean binary program doc manpages docbook test update-po: startup dirs
++all headers library clean veryclean binary program doc manpages docbook update-po: startup dirs
+
+ dirs: startup
+
+diff --git a/configure.ac b/configure.ac
+index 5663aaf..b0f9564 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -89,12 +89,6 @@ AC_CHECK_LIB(curl, curl_easy_init,
+ AC_MSG_ERROR([failed: I need CURL due https support]),
+ )
+
+-AC_LANG_PUSH([C++])
+-AC_CHECK_HEADER(gtest/gtest.h,,
+- AC_MSG_ERROR([failed: I need gtest to build tests]),
+-)
+-AC_LANG_POP([C++])
+-
+
+ AC_SUBST(BDBLIB)
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch
new file mode 100644
index 000000000..801ae6ddd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch
@@ -0,0 +1,12 @@
+Upstream-Status: Pending
+
+--- a/apt-pkg/contrib/weakptr.h
++++ b/apt-pkg/contrib/weakptr.h
+@@ -21,6 +21,7 @@
+ #ifndef WEAK_POINTER_H
+ #define WEAK_POINTER_H
+
++#include <cstdlib>
+ #include <set>
+ /**
+ * Class for objects providing support for weak pointers.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/makerace.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/makerace.patch
new file mode 100644
index 000000000..46e3161b6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/makerace.patch
@@ -0,0 +1,23 @@
+I was seeing various issues with parallel make, mainly due to to what was likely
+partially installed headers. If you change into the source directory and
+"NOISY=1 make ../obj/apt-pkg/sourcelist.opic" in apt-pkg, you'll see it
+doesn't have any dependencies on the headers being installed. This patch
+fixes that so things build correctly.
+
+RP 2012/3/19
+
+Upstream-Status: Pending
+
+Index: apt-0.9.9.4/buildlib/library.mak
+===================================================================
+--- apt-0.9.9.4.orig/buildlib/library.mak 2013-07-31 15:45:07.320440575 +0300
++++ apt-0.9.9.4/buildlib/library.mak 2013-07-31 15:46:49.440440561 +0300
+@@ -61,7 +61,7 @@
+
+ # Compilation rules
+ vpath %.cc $(SUBDIRS)
+-$(OBJ)/%.opic: %.cc $(LIBRARYDEPENDS)
++$(OBJ)/%.opic: %.cc $(LIBRARYDEPENDS) $($(LOCAL)-HEADERS)
+ echo Compiling $< to $@
+ $(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) $(PICFLAGS) -o $@ $<
+ $(DoDep)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch
new file mode 100644
index 000000000..a0996d4d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+--- a/apt-pkg/deb/dpkgpm.cc
++++ b/apt-pkg/deb/dpkgpm.cc
+@@ -42,6 +42,12 @@
+ #include <apti18n.h>
+ /*}}}*/
+
++#ifdef USE_NLS
++#define _dpkg(x) dgettext("dpkg", x)
++#else
++#define _dpkg(x) x
++#endif
++
+ using namespace std;
+
+ namespace
+@@ -1279,7 +1285,7 @@ void pkgDPkgPM::WriteApportReport(const
+ }
+
+ // check if its not a follow up error
+- const char *needle = dgettext("dpkg", "dependency problems - leaving unconfigured");
++ const char *needle = _dpkg("dependency problems - leaving unconfigured");
+ if(strstr(errormsg, needle) != NULL) {
+ std::clog << _("No apport report written because the error message indicates its a followup error from a previous failure.") << std::endl;
+ return;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/noconfigure.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/noconfigure.patch
new file mode 100644
index 000000000..ebc67203b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/noconfigure.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+
+diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
+index 249542c..0a1911f 100644
+--- a/apt-pkg/packagemanager.cc
++++ b/apt-pkg/packagemanager.cc
+@@ -952,10 +952,12 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
+ return false;
+
+ if (Immediate == true) {
++#if 0
+ // Perform immedate configuration of the package.
+ if (SmartConfigure(Pkg, Depth + 1) == false)
+ _error->Error(_("Could not perform immediate configuration on '%s'. "
+ "Please see man 5 apt.conf under APT::Immediate-Configure for details. (%d)"),Pkg.FullName().c_str(),2);
++#endif
+ }
+
+ return true;
+@@ -1038,6 +1040,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
+ }
+ }
+
++#if 0
+ // Final run through the configure phase
+ if (ConfigureAll() == false)
+ return Failed;
+@@ -1052,6 +1055,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
+ return Failed;
+ }
+ }
++#endif
+
+ return Completed;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/nodoc.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/nodoc.patch
new file mode 100644
index 000000000..449e42df4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/nodoc.patch
@@ -0,0 +1,18 @@
+Disable documentation
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: apt-0.9.7.7/Makefile
+===================================================================
+--- apt-0.9.7.7.orig/Makefile
++++ apt-0.9.7.7/Makefile
+@@ -17,7 +17,7 @@ all headers library clean veryclean bina
+ $(MAKE) -C cmdline $@
+ $(MAKE) -C ftparchive $@
+ $(MAKE) -C dselect $@
+- $(MAKE) -C doc $@
++# $(MAKE) -C doc $@
+ $(MAKE) -C po $@
+ $(MAKE) -C test $@
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/truncate-filename.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/truncate-filename.patch
new file mode 100644
index 000000000..db1c42b66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/truncate-filename.patch
@@ -0,0 +1,35 @@
+strutl.cc: the filename can't be longer than 255
+
+The URItoFileName translates the path into the filename, but the
+filename can't be longer than 255 according to
+/usr/include/linux/limits.h.
+
+Truncate it when it is longer than 240 (leave some spaces for
+".Packages" and "._Release" suffix)
+
+Upstream-Status: Pending
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ apt-pkg/contrib/strutl.cc | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
+--- a/apt-pkg/contrib/strutl.cc
++++ b/apt-pkg/contrib/strutl.cc
+@@ -399,7 +399,12 @@ string URItoFileName(const string &URI)
+ // "\x00-\x20{}|\\\\^\\[\\]<>\"\x7F-\xFF";
+ string NewURI = QuoteString(U,"\\|{}[]<>\"^~_=!@#$%^&*");
+ replace(NewURI.begin(),NewURI.end(),'/','_');
+- return NewURI;
++
++ // Truncate from the head when it is longer than 240
++ if(NewURI.length() > 240)
++ return NewURI.substr(NewURI.length() - 240, NewURI.length() - 1);
++ else
++ return NewURI;
+ }
+ /*}}}*/
+ // Base64Encode - Base64 Encoding routine for short strings /*{{{*/
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/use-host.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/use-host.patch
new file mode 100644
index 000000000..b30fcff0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt/use-host.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Index: apt-0.9.7.7/configure.ac
+===================================================================
+--- apt-0.9.7.7.orig/configure.ac
++++ apt-0.9.7.7/configure.ac
+@@ -112,7 +112,7 @@ dnl This is often the dpkg architecture
+ dnl First check against the full canonical canoncial-system-type in $target
+ dnl and if that fails, just look for the cpu
+ AC_MSG_CHECKING(debian architecture)
+-archset="`dpkg-architecture -qDEB_HOST_ARCH`"
++archset="`echo $host_alias|cut -d'-' -f1`"
+ if test "x$archset" = "x"; then
+ AC_MSG_ERROR([failed: use --host= or output from dpkg-architecture])
+ fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/apt_1.0.10.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt_1.0.10.1.bb
new file mode 100644
index 000000000..85c0d5615
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/apt_1.0.10.1.bb
@@ -0,0 +1,19 @@
+DEPENDS = "curl db zlib"
+RDEPENDS_${PN} = "dpkg bash debianutils"
+require apt.inc
+
+require apt-package.inc
+
+PACKAGECONFIG ??= "lzma"
+PACKAGECONFIG[lzma] = "ac_cv_lib_lzma_lzma_easy_encoder=yes,ac_cv_lib_lzma_lzma_easy_encoder=no,xz"
+PACKAGECONFIG[bz2] = "ac_cv_lib_bz2_BZ2_bzopen=yes,ac_cv_lib_bz2_BZ2_bzopen=no,bzip2"
+
+FILES_${PN} += "${bindir}/apt-key"
+apt-manpages += "doc/apt-key.8"
+
+do_install_append() {
+ #Write the correct apt-architecture to apt.conf
+ APT_CONF=${D}/etc/apt/apt.conf
+ echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF}
+ oe_libinstall -so -C bin libapt-private ${D}${libdir}/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/files/apt.conf b/import-layers/yocto-poky/meta/recipes-devtools/apt/files/apt.conf
new file mode 100644
index 000000000..03351356b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/files/apt.conf
@@ -0,0 +1,42 @@
+Dir "${STAGING_DIR_NATIVE}/"
+{
+ State "var/lib/apt/"
+ {
+ Lists "#APTCONF#/lists/";
+ status "#ROOTFS#/var/lib/dpkg/status";
+ };
+ Cache "var/cache/apt/"
+ {
+ Archives "archives/";
+ pkgcache "";
+ srcpkgcache "";
+ };
+ Bin "${STAGING_BINDIR_NATIVE}/"
+ {
+ methods "${STAGING_LIBDIR}/apt/methods/";
+ gzip "/bin/gzip";
+ dpkg "dpkg";
+ dpkg-source "dpkg-source";
+ dpkg-buildpackage "dpkg-buildpackage";
+ apt-get "apt-get";
+ apt-cache "apt-cache";
+ };
+ Etc "#APTCONF#"
+ {
+ Preferences "preferences";
+ };
+};
+
+APT
+{
+ Install-Recommends "true";
+ Immediate-Configure "false";
+ Architecture "i586";
+ Get
+ {
+ Assume-Yes "true";
+ Force-Yes "true"
+ };
+};
+
+DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"};
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/files/db_linking_hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/files/db_linking_hack.patch
new file mode 100644
index 000000000..a61d4b07c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/files/db_linking_hack.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Backport
+
+Index: apt-0.7.3/configure.ac
+===================================================================
+--- apt-0.7.3.orig/configure.ac 2007-07-01 10:38:45.000000000 +0000
++++ apt-0.7.3/configure.ac 2007-08-21 13:39:26.000000000 +0000
+@@ -67,8 +67,20 @@
+ [AC_DEFINE(HAVE_BDB)
+ BDBLIB="-ldb"
+ AC_MSG_RESULT(yes)],
+- [BDBLIB=""
+- AC_MSG_RESULT(no)]
++
++ LIBS="$LIBS -lpthread"
++ [AC_MSG_CHECKING(if we can link against BerkeleyDB with pthread)
++ AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [#include <db.h>],
++ [int r, s, t; db_version(&r, &s, &t);]
++ )],
++ [AC_DEFINE(HAVE_BDB)
++ BDBLIB="-ldb -lpthread"
++ AC_MSG_RESULT(yes)],
++ [BDBLIB=""
++ AC_MSG_RESULT(no)]
++ )]
+ )]
+ )
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/files/environment.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/files/environment.patch
new file mode 100644
index 000000000..9a0303803
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/files/environment.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Backport
+
+Index: apt-0.6.46.2/buildlib/environment.mak.in
+===================================================================
+--- apt-0.6.46.2.orig/buildlib/environment.mak.in 2007-03-29 11:38:58.000000000 +0100
++++ apt-0.6.46.2/buildlib/environment.mak.in 2007-03-29 11:39:12.000000000 +0100
+@@ -62,7 +62,7 @@
+
+ # Shared library things
+ HOST_OS = @host_os@
+-ifneq ($(words $(filter linux-gnu gnu% %gnu,$(HOST_OS))),0)
++ifneq ($(words $(filter linux-gnu linux-gnueabi gnu% %gnu,$(HOST_OS))),0)
+ SONAME_MAGIC=-Wl,-soname -Wl,
+ LFLAGS_SO=
+ else
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/apt/files/no-curl.patch b/import-layers/yocto-poky/meta/recipes-devtools/apt/files/no-curl.patch
new file mode 100644
index 000000000..30238faad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/apt/files/no-curl.patch
@@ -0,0 +1,38 @@
+Upstream-Status: Inappropriate [configuration]
+
+---
+ configure.in | 6 ------
+ methods/makefile | 7 -------
+ 2 files changed, 13 deletions(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -86,12 +86,6 @@ AC_CHECK_HEADER(db.h,
+
+ LIBS="$saveLIBS"
+
+-AC_CHECK_LIB(curl, curl_easy_init,
+- [AC_CHECK_HEADER(curl/curl.h,
+- curl_ok=yes,
+- curl_ok=no)],
+- AC_MSG_ERROR([failed: I need CURL due https support]),
+-)
+
+ AC_SUBST(BDBLIB)
+
+--- a/methods/makefile
++++ b/methods/makefile
+@@ -51,13 +51,6 @@ LIB_MAKES = apt-pkg/makefile
+ SOURCE = http.cc http_main.cc rfc2553emu.cc connect.cc server.cc
+ include $(PROGRAM_H)
+
+-# The https method
+-PROGRAM=https
+-SLIBS = -lapt-pkg -lcurl $(INTLLIBS)
+-LIB_MAKES = apt-pkg/makefile
+-SOURCE = https.cc server.cc
+-include $(PROGRAM_H)
+-
+ # The ftp method
+ PROGRAM=ftp
+ SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf.inc b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf.inc
new file mode 100644
index 000000000..b4e33569a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf.inc
@@ -0,0 +1,44 @@
+SUMMARY = "A GNU tool that procude shell scripts to automatically configure software"
+DESCRIPTION = "Autoconf is an extensible package of M4 macros that produce shell scripts to automatically \
+configure software source code packages. Autoconf creates a configuration script for a package from a template \
+file that lists the operating system features that the package can use, in the form of M4 macro calls."
+LICENSE = "GPLv3"
+HOMEPAGE = "http://www.gnu.org/software/autoconf/"
+SECTION = "devel"
+DEPENDS += "m4-native"
+DEPENDS_class-native = "m4-native gnu-config-native"
+DEPENDS_class-nativesdk = "nativesdk-m4 nativesdk-gnu-config"
+RDEPENDS_${PN} = "m4 gnu-config \
+ perl \
+ perl-module-carp \
+ perl-module-constant \
+ perl-module-errno \
+ perl-module-exporter \
+ perl-module-file-basename \
+ perl-module-file-compare \
+ perl-module-file-copy \
+ perl-module-file-glob \
+ perl-module-file-path \
+ perl-module-file-stat \
+ perl-module-file-find \
+ perl-module-getopt-long \
+ perl-module-io-file \
+ perl-module-posix \
+ perl-module-data-dumper \
+ "
+RDEPENDS_${PN}_class-native = "m4-native gnu-config-native"
+
+SRC_URI = "${GNU_MIRROR}/autoconf/autoconf-${PV}.tar.gz \
+ file://program_prefix.patch"
+
+inherit autotools texinfo
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL=${USRBINPATH}/perl"
+
+do_configure() {
+ oe_runconf
+}
+
+do_install_append() {
+ rm -rf ${D}${datadir}/emacs
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch
new file mode 100644
index 000000000..a9094d212
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch
@@ -0,0 +1,26 @@
+backport http://git.savannah.gnu.org/cgit/config.git/commit/config.sub?id=062587eaa891396c936555ae51f7e77eeb71a5fe
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+Index: autoconf-2.69/build-aux/config.sub
+===================================================================
+--- autoconf-2.69.orig/build-aux/config.sub
++++ autoconf-2.69/build-aux/config.sub
+@@ -123,7 +123,7 @@ esac
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
++ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+@@ -1360,7 +1360,7 @@ case $os in
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-android* \
+- | -linux-newlib* | -linux-uclibc* \
++ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch
new file mode 100644
index 000000000..d1bd3a2a3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch
@@ -0,0 +1,139 @@
+Upstream-Status: Pending
+
+Index: autoconf-2.63/bin/autoreconf.in
+===================================================================
+--- autoconf-2.63.orig/bin/autoreconf.in 2008-12-31 17:39:01.000000000 +0000
++++ autoconf-2.63/bin/autoreconf.in 2008-12-31 17:43:38.000000000 +0000
+@@ -76,6 +76,7 @@
+ -i, --install copy missing auxiliary files
+ --no-recursive don't rebuild sub-packages
+ -s, --symlink with -i, install symbolic links instead of copies
++ -x, --exclude=STEPS steps we should not run
+ -m, --make when applicable, re-run ./configure && make
+ -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
+
+@@ -136,6 +137,13 @@
+ # Recurse into subpackages
+ my $recursive = 1;
+
++# Steps to exclude
++my @exclude;
++my @ex;
++
++my $uses_gettext;
++my $configure_ac;
++
+ ## ---------- ##
+ ## Routines. ##
+ ## ---------- ##
+@@ -153,6 +161,7 @@
+ 'B|prepend-include=s' => \@prepend_include,
+ 'i|install' => \$install,
+ 's|symlink' => \$symlink,
++ 'x|exclude=s' => \@exclude,
+ 'm|make' => \$run_make,
+ 'recursive!' => \$recursive);
+
+@@ -162,6 +171,8 @@
+ parse_WARNINGS;
+ parse_warnings '--warnings', @warning;
+
++ @exclude = map { split /,/ } @exclude;
++
+ # Even if the user specified a configure.ac, trim to get the
+ # directory, and look for configure.ac again. Because (i) the code
+ # is simpler, and (ii) we are still able to diagnose simultaneous
+@@ -255,6 +266,11 @@
+ {
+ my ($aclocal, $flags) = @_;
+
++ @ex = grep (/^aclocal$/, @exclude);
++ if ($#ex != -1) {
++ return;
++ }
++
+ # aclocal 1.8+ does all this for free. It can be recognized by its
+ # --force support.
+ if ($aclocal_supports_force)
+@@ -368,7 +384,10 @@
+ }
+ else
+ {
+- xsystem_hint ("autopoint is needed because this package uses Gettext", "$autopoint");
++ @ex = grep (/^autopoint$/, @exclude);
++ if ($#ex == -1) {
++ xsystem_hint ("autopoint is needed because this package uses Gettext", "$autopoint");
++ }
+ }
+
+
+@@ -532,16 +551,17 @@
+ {
+ $libtoolize .= " --ltdl";
+ }
+- xsystem_hint ("libtoolize is needed because this package uses Libtool", $libtoolize);
+- $rerun_aclocal = 1;
++ @ex = grep (/^libtoolize$/, @exclude);
++ if ($#ex == -1) {
++ xsystem_hint ("libtoolize is needed because this package uses Libtool", $libtoolize);
++ $rerun_aclocal = 1;
++ }
+ }
+ else
+ {
+ verb "$configure_ac: not running libtoolize: --install not given";
+ }
+
+-
+-
+ # ------------------- #
+ # Rerunning aclocal. #
+ # ------------------- #
+@@ -572,7 +592,10 @@
+ # latter runs the former, and (ii) autoconf is stricter than
+ # autoheader. So all in all, autoconf should give better error
+ # messages.
+- xsystem ($autoconf);
++ @ex = grep (/^autoconf$/, @exclude);
++ if ($#ex == -1) {
++ xsystem ("$autoconf");
++ }
+
+
+ # -------------------- #
+@@ -593,7 +616,10 @@
+ }
+ else
+ {
+- xsystem ($autoheader);
++ @ex = grep (/^autoheader$/, @exclude);
++ if ($#ex == -1) {
++ xsystem ("$autoheader");
++ }
+ }
+
+
+@@ -610,7 +636,10 @@
+ # We should always run automake, and let it decide whether it shall
+ # update the file or not. In fact, the effect of `$force' is already
+ # included in `$automake' via `--no-force'.
+- xsystem ($automake);
++ @ex = grep (/^automake$/, @exclude);
++ if ($#ex == -1) {
++ xsystem ("$automake");
++ }
+ }
+
+
+@@ -634,7 +663,10 @@
+ }
+ else
+ {
+- xsystem ("$make");
++ @ex = grep (/^make$/, @exclude);
++ if ($#ex == -1) {
++ xsystem ("$make");
++ }
+ }
+ }
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch
new file mode 100644
index 000000000..5ff18c235
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch
@@ -0,0 +1,38 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+Index: autoconf-2.63/bin/autoreconf.in
+===================================================================
+--- autoconf-2.63.orig/bin/autoreconf.in 2008-12-31 17:43:55.000000000 +0000
++++ autoconf-2.63/bin/autoreconf.in 2008-12-31 17:46:16.000000000 +0000
+@@ -58,7 +58,7 @@
+ $help = "Usage: $0 [OPTION]... [DIRECTORY]...
+
+ Run `autoconf' (and `autoheader', `aclocal', `automake', `autopoint'
+-(formerly `gettextize'), and `libtoolize' where appropriate)
++(formerly `gettextize'), `libtoolize', and `gnu-configize' where appropriate)
+ repeatedly to remake the GNU Build System files in specified
+ DIRECTORIES and their subdirectories (defaulting to `.').
+
+@@ -115,6 +115,7 @@
+ my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
+ my $autopoint = $ENV{'AUTOPOINT'} || 'autopoint';
+ my $make = $ENV{'MAKE'} || 'make';
++my $gnuconfigize = $ENV{'GNUCONFIGIZE'} || 'gnu-configize';
+
+ # --install -- as --add-missing in other tools.
+ my $install = 0;
+@@ -644,6 +645,10 @@
+ }
+ }
+
++ @ex = grep (/^gnu-configize$/, @exclude);
++ if ($#ex == -1) {
++ xsystem ("$gnuconfigize");
++ }
+
+ # -------------- #
+ # Running make. #
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch
new file mode 100644
index 000000000..31326f0bc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Pending
+
+Index: autoconf-2.63/bin/autoreconf.in
+===================================================================
+--- autoconf-2.63.orig/bin/autoreconf.in 2008-08-28 03:08:10.000000000 +0100
++++ autoconf-2.63/bin/autoreconf.in 2008-12-31 17:38:40.000000000 +0000
+@@ -190,6 +190,7 @@
+ $autoconf .= join (' --prepend-include=', '', map { shell_quote ($_) } @prepend_include);
+ $autoheader .= join (' --include=', '', map { shell_quote ($_) } @include);
+ $autoheader .= join (' --prepend-include=', '', map { shell_quote ($_) } @prepend_include);
++ $aclocal .= join (' -I ', '', map { shell_quote ($_) } @include);
+
+ # --install and --symlink;
+ if ($install)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch
new file mode 100644
index 000000000..b5e8174ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch
@@ -0,0 +1,136 @@
+From a7e722f974e2529d3e564d8d94c86cc8bdbc40e7 Mon Sep 17 00:00:00 2001
+From: Radu Patriu <radu.patriu@enea.com>
+Date: Mon, 24 Mar 2014 16:33:19 +0200
+Subject: [PATCH] autotest: new testsuite option to enable automake test
+ result format
+
+* lib/autotest/general.m4: added "--am-fmt | -A" command line
+parameter for testsuite script to enable "RESULT: testname" output;
+will be used by yocto ptest packages.
+
+Upstream-Status: Pending
+
+Signed-off-by: Radu Patriu <radu.patriu@enea.com>
+---
+ lib/autotest/general.m4 | 39 +++++++++++++++++++++++++++++----------
+ 1 file changed, 29 insertions(+), 10 deletions(-)
+
+diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
+index 60c0352..c1f5a9b 100644
+--- a/lib/autotest/general.m4
++++ b/lib/autotest/general.m4
+@@ -412,6 +412,9 @@ at_recheck=
+ # Whether a write failure occurred
+ at_write_fail=0
+
++# Automake result format "result: testname"
++at_am_fmt=false
++
+ # The directory we run the suite in. Default to . if no -C option.
+ at_dir=`pwd`
+ # An absolute reference to this testsuite script.
+@@ -530,6 +533,10 @@ do
+ at_check_filter_trace=at_fn_filter_trace
+ ;;
+
++ --am-fmt | -A )
++ at_am_fmt=:
++ ;;
++
+ [[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]])
+ at_fn_validate_ranges at_option
+ AS_VAR_APPEND([at_groups], ["$at_option$as_nl"])
+@@ -718,10 +725,10 @@ m4_divert_push([HELP_MODES])dnl
+ cat <<_ATEOF || at_write_fail=1
+
+ Operation modes:
+- -h, --help print the help message, then exit
+- -V, --version print version number, then exit
+- -c, --clean remove all the files this test suite might create and exit
+- -l, --list describes all the tests, or the selected TESTS
++ -h, --help print the help message, then exit
++ -V, --version print version number, then exit
++ -c, --clean remove all the files this test suite might create and exit
++ -l, --list describes all the tests, or the selected TESTS
+ _ATEOF
+ m4_divert_pop([HELP_MODES])dnl
+ m4_wrap([m4_divert_push([HELP_TUNING_BEGIN])dnl
+@@ -747,6 +754,7 @@ Execution tuning:
+ -d, --debug inhibit clean up and top-level logging
+ [ default for debugging scripts]
+ -x, --trace enable tests shell tracing
++ -A, --am-fmt automake result format "result: testname"
+ _ATEOF
+ m4_divert_pop([HELP_TUNING_BEGIN])])dnl
+ m4_divert_push([HELP_END])dnl
+@@ -1162,7 +1170,9 @@ at_fn_group_banner ()
+ [*]) at_desc_line="$[1]: " ;;
+ esac
+ AS_VAR_APPEND([at_desc_line], ["$[3]$[4]"])
+- $at_quiet AS_ECHO_N(["$at_desc_line"])
++ if ! $at_am_fmt; then
++ $at_quiet AS_ECHO_N(["$at_desc_line"])
++ fi
+ echo "# -*- compilation -*-" >> "$at_group_log"
+ }
+
+@@ -1188,42 +1198,51 @@ _ATEOF
+ case $at_xfail:$at_status in
+ yes:0)
+ at_msg="UNEXPECTED PASS"
++ at_am_msg="XPASS"
+ at_res=xpass
+ at_errexit=$at_errexit_p
+ at_color=$at_red
+ ;;
+ no:0)
+ at_msg="ok"
++ at_am_msg="PASS"
+ at_res=pass
+ at_errexit=false
+ at_color=$at_grn
+ ;;
+ *:77)
+ at_msg='skipped ('`cat "$at_check_line_file"`')'
++ at_am_msg="SKIP"
+ at_res=skip
+ at_errexit=false
+ at_color=$at_blu
+ ;;
+ no:* | *:99)
+ at_msg='FAILED ('`cat "$at_check_line_file"`')'
++ at_am_msg="FAIL"
+ at_res=fail
+ at_errexit=$at_errexit_p
+ at_color=$at_red
+ ;;
+ yes:*)
+ at_msg='expected failure ('`cat "$at_check_line_file"`')'
++ at_am_msg="XFAIL"
+ at_res=xfail
+ at_errexit=false
+ at_color=$at_lgn
+ ;;
+ esac
+ echo "$at_res" > "$at_job_dir/$at_res"
+- # In parallel mode, output the summary line only afterwards.
+- if test $at_jobs -ne 1 && test -n "$at_verbose"; then
+- AS_ECHO(["$at_desc_line $at_color$at_msg$at_std"])
++ if $at_am_fmt; then
++ AS_ECHO(["$at_am_msg: $at_desc"])
+ else
+- # Make sure there is a separator even with long titles.
+- AS_ECHO([" $at_color$at_msg$at_std"])
++ # In parallel mode, output the summary line only afterwards.
++ if test $at_jobs -ne 1 && test -n "$at_verbose"; then
++ AS_ECHO(["$at_desc_line $at_color$at_msg$at_std"])
++ else
++ # Make sure there is a separator even with long titles.
++ AS_ECHO([" $at_color$at_msg$at_std"])
++ fi
+ fi
+ at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
+ case $at_status in
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch
new file mode 100644
index 000000000..73394d7d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch
@@ -0,0 +1,34 @@
+Use --warning=cross only if supported by automake
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+--- a/bin/autoreconf.in
++++ b/bin/autoreconf.in
+@@ -127,6 +127,8 @@ my $aclocal_supports_warnings = 0;
+ my $automake_supports_force_missing = 0;
+ # Does automake support -Wfoo?
+ my $automake_supports_warnings = 0;
++# Does automake support --warning=cross
++my $automake_supports_cross_warning = 0;
+
+ my @prepend_include;
+ my @include;
+@@ -191,6 +193,7 @@ sub parse_args ()
+ $aclocal_supports_warnings = $aclocal_help =~ /--warnings/;
+ $automake_supports_force_missing = $automake_help =~ /--force-missing/;
+ $automake_supports_warnings = $automake_help =~ /--warnings/;
++ $automake_supports_cross_warning = $automake_help =~ /cross/;
+
+ # Dispatch autoreconf's option to the tools.
+ # --include;
+@@ -244,6 +247,8 @@ sub parse_args ()
+ $libtoolize .= ' --debug';
+ }
+ # --warnings;
++ @warning = grep { $_ ne "cross" } @warning
++ if ! $automake_supports_cross_warning;
+ if (@warning)
+ {
+ my $warn = ' --warnings=' . join (',', @warning);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/config_site.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/config_site.patch
new file mode 100644
index 000000000..9f044404d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/config_site.patch
@@ -0,0 +1,40 @@
+Upstream-Status: Pending
+
+Poky provides a list of site files in CONFIG_SITE whereas autoconf
+only expects one file. This patch changes autoconf to accept a list of
+them.
+
+RP 1/2/10
+
+Updated for 2.68 version: the CONFIG_SITE var was not getting used at all
+fixed the 2.68 code
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/05/27
+
+Index: autoconf-2.68/lib/autoconf/general.m4
+===================================================================
+--- autoconf-2.68.orig/lib/autoconf/general.m4
++++ autoconf-2.68/lib/autoconf/general.m4
+@@ -1878,7 +1878,6 @@ AU_DEFUN([AC_VALIDATE_CACHED_SYSTEM_TUPL
+ m4_define([AC_SITE_LOAD],
+ [# Prefer an explicitly selected file to automatically selected ones.
+ ac_site_file1=NONE
+-ac_site_file2=NONE
+ if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in @%:@((
+@@ -1886,14 +1885,8 @@ if test -n "$CONFIG_SITE"; then
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+-elif test "x$prefix" != xNONE; then
+- ac_site_file1=$prefix/share/config.site
+- ac_site_file2=$prefix/etc/config.site
+-else
+- ac_site_file1=$ac_default_prefix/share/config.site
+- ac_site_file2=$ac_default_prefix/etc/config.site
+ fi
+-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
++for ac_site_file in $ac_site_file1
+ do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch
new file mode 100644
index 000000000..65df88f8f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch
@@ -0,0 +1,120 @@
+Upstream-Status: Pending
+
+We don't build xmkmf so any values returned from it are going to be wrong.
+Using any paths in /usr/ for x headers/libs is a bad idea when cross compiling.
+This patch removes them to stop any confusion.
+
+RP - 20071115
+
+Index: autoconf-2.68/lib/autoconf/libs.m4
+===================================================================
+--- autoconf-2.68.orig/lib/autoconf/libs.m4
++++ autoconf-2.68/lib/autoconf/libs.m4
+@@ -159,53 +159,6 @@ m4_popdef([AC_Lib_Name])dnl
+ # --------------------- #
+
+
+-# _AC_PATH_X_XMKMF
+-# ----------------
+-# Internal subroutine of _AC_PATH_X.
+-# Set ac_x_includes and/or ac_x_libraries.
+-m4_define([_AC_PATH_X_XMKMF],
+-[AC_ARG_VAR(XMKMF, [Path to xmkmf, Makefile generator for X Window System])dnl
+-rm -f -r conftest.dir
+-if mkdir conftest.dir; then
+- cd conftest.dir
+- cat >Imakefile <<'_ACEOF'
+-incroot:
+- @echo incroot='${INCROOT}'
+-usrlibdir:
+- @echo usrlibdir='${USRLIBDIR}'
+-libdir:
+- @echo libdir='${LIBDIR}'
+-_ACEOF
+- if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+- # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+- for ac_var in incroot usrlibdir libdir; do
+- eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+- done
+- # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+- for ac_extension in a so sl dylib la dll; do
+- if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+- test -f "$ac_im_libdir/libX11.$ac_extension"; then
+- ac_im_usrlibdir=$ac_im_libdir; break
+- fi
+- done
+- # Screen out bogus values from the imake configuration. They are
+- # bogus both because they are the default anyway, and because
+- # using them would break gcc on systems where it needs fixed includes.
+- case $ac_im_incroot in
+- /usr/include) ac_x_includes= ;;
+- *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+- esac
+- case $ac_im_usrlibdir in
+- /usr/lib | /usr/lib64 | /lib | /lib64) ;;
+- *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+- esac
+- fi
+- cd ..
+- rm -f -r conftest.dir
+-fi
+-])# _AC_PATH_X_XMKMF
+-
+-
+ # _AC_PATH_X_DIRECT
+ # -----------------
+ # Internal subroutine of _AC_PATH_X.
+@@ -213,44 +166,7 @@ fi
+ m4_define([_AC_PATH_X_DIRECT],
+ [# Standard set of common directories for X headers.
+ # Check X11 before X11Rn because it is often a symlink to the current release.
+-ac_x_header_dirs='
+-/usr/X11/include
+-/usr/X11R7/include
+-/usr/X11R6/include
+-/usr/X11R5/include
+-/usr/X11R4/include
+-
+-/usr/include/X11
+-/usr/include/X11R7
+-/usr/include/X11R6
+-/usr/include/X11R5
+-/usr/include/X11R4
+-
+-/usr/local/X11/include
+-/usr/local/X11R7/include
+-/usr/local/X11R6/include
+-/usr/local/X11R5/include
+-/usr/local/X11R4/include
+-
+-/usr/local/include/X11
+-/usr/local/include/X11R7
+-/usr/local/include/X11R6
+-/usr/local/include/X11R5
+-/usr/local/include/X11R4
+-
+-/usr/X386/include
+-/usr/x386/include
+-/usr/XFree86/include/X11
+-
+-/usr/include
+-/usr/local/include
+-/usr/unsupported/include
+-/usr/athena/include
+-/usr/local/x11r5/include
+-/usr/lpp/Xamples/include
+-
+-/usr/openwin/include
+-/usr/openwin/share/include'
++ac_x_header_dirs=''
+
+ if test "$ac_x_includes" = no; then
+ # Guess where to find include files, by looking for Xlib.h.
+@@ -299,7 +215,6 @@ AC_DEFUN([_AC_PATH_X],
+ [AC_CACHE_VAL(ac_cv_have_x,
+ [# One or both of the vars are not set, and there is no cached value.
+ ac_x_includes=no ac_x_libraries=no
+-_AC_PATH_X_XMKMF
+ _AC_PATH_X_DIRECT
+ case $ac_x_includes,$ac_x_libraries in #(
+ no,* | *,no | *\'*)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/performance.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/performance.patch
new file mode 100644
index 000000000..1842fe92b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/performance.patch
@@ -0,0 +1,60 @@
+The check for solaris 'print' causes significant problems on a linux machine
+with dash as /bin/sh since it triggers the execution of "print" which on some
+linux systems is a perl script which is part of mailcap. Worse, this perl
+script calls "which file" and if successful ignores the path file was found
+in and just runs "file" without a path. Each exection causes PATH to be searched.
+
+Simply assuming the shell's printf function works cuts out all the fork overhead
+and when parallel tasks are running, this overhead appears to be significant.
+
+RP
+2015/11/28
+Upstream-Status: Inappropriate
+
+Index: autoconf-2.69/lib/m4sugar/m4sh.m4
+===================================================================
+--- autoconf-2.69.orig/lib/m4sugar/m4sh.m4
++++ autoconf-2.69/lib/m4sugar/m4sh.m4
+@@ -1045,40 +1045,8 @@ m4_defun([_AS_ECHO_PREPARE],
+ [[as_nl='
+ '
+ export as_nl
+-# Printing a long string crashes Solaris 7 /usr/bin/printf.
+-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+-# Prefer a ksh shell builtin over an external printf program on Solaris,
+-# but without wasting forks for bash or zsh.
+-if test -z "$BASH_VERSION$ZSH_VERSION" \
+- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+- as_echo='print -r --'
+- as_echo_n='print -rn --'
+-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+- as_echo='printf %s\n'
+- as_echo_n='printf %s'
+-else
+- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+- as_echo_body='eval /usr/ucb/echo -n "$][1$as_nl"'
+- as_echo_n='/usr/ucb/echo -n'
+- else
+- as_echo_body='eval expr "X$][1" : "X\\(.*\\)"'
+- as_echo_n_body='eval
+- arg=$][1;
+- case $arg in @%:@(
+- *"$as_nl"*)
+- expr "X$arg" : "X\\(.*\\)$as_nl";
+- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+- esac;
+- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+- '
+- export as_echo_n_body
+- as_echo_n='sh -c $as_echo_n_body as_echo'
+- fi
+- export as_echo_body
+- as_echo='sh -c $as_echo_body as_echo'
+-fi
++as_echo='printf %s\n'
++as_echo_n='printf %s'
+ ]])# _AS_ECHO_PREPARE
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/preferbash.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/preferbash.patch
new file mode 100644
index 000000000..fa76ee9bd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/preferbash.patch
@@ -0,0 +1,25 @@
+This value is used to determine CONFIG_SHELL and SHELL which may get exported into
+scripts shared via sstate onto other systems.
+
+Some systems have /bin/sh -> dash and others /bin/sh -> bash. Bash is preferred
+but sometimes we can sometimes end up exporting /bin/sh yet use bashisms.
+
+This patch puts bash first in the search results which avoids the bash/dash confusion.
+
+RP 2012/9/23
+
+Upstream-Status: Inappropriate [OE specific configuration]
+
+Index: autoconf-2.69/lib/m4sugar/m4sh.m4
+===================================================================
+--- autoconf-2.69.orig/lib/m4sugar/m4sh.m4 2012-03-07 17:35:26.000000000 +0000
++++ autoconf-2.69/lib/m4sugar/m4sh.m4 2013-09-23 16:12:38.853597515 +0000
+@@ -229,7 +229,7 @@
+ [_AS_PATH_WALK([/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH],
+ [case $as_dir in @%:@(
+ /*)
+- for as_base in sh bash ksh sh5; do
++ for as_base in bash sh ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ AS_IF([{ test -f "$as_shell" || test -f "$as_shell.exe"; } &&
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch
new file mode 100644
index 000000000..978a401f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- autoconf-2.57/lib/autoconf/general.m4~program_prefix
++++ autoconf-2.57/lib/autoconf/general.m4
+@@ -1676,8 +1676,9 @@
+ # The aliases save the names the user supplied, while $host etc.
+ # will get canonicalized.
+ test -n "$target_alias" &&
+- test "$program_prefix$program_suffix$program_transform_name" = \
+- NONENONEs,x,x, &&
++ test "$target_alias" != "$host_alias" &&
++ test "$program_prefix$program_suffix$program_transform_name" = \
++ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-[]dnl
+ ])# AC_CANONICAL_TARGET
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch
new file mode 100644
index 000000000..55d2e2fe7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch
@@ -0,0 +1,29 @@
+We have problem using hardcoded directories like /usr/local here
+which will be checked for cross builds. This is a special case which
+is valid for AIX only. We do not have AIX as one of our supported
+build host or target. Therefore we get rid of the hardcoded paths
+and make life easier for cross compilation process.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [Upstream does care for AIX while we may not]
+Index: autoconf-2.68/lib/autoconf/functions.m4
+===================================================================
+--- autoconf-2.68.orig/lib/autoconf/functions.m4 2010-09-22 14:52:19.000000000 -0700
++++ autoconf-2.68/lib/autoconf/functions.m4 2011-08-03 11:57:05.822199513 -0700
+@@ -749,15 +749,6 @@ if test $ac_have_func = no; then
+ [LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes])
+ fi
+
+-if test $ac_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.
+- ac_getloadavg_LIBS=$LIBS
+- LIBS="-L/usr/local/lib $LIBS"
+- AC_CHECK_LIB(getloadavg, getloadavg,
+- [LIBS="-lgetloadavg $LIBS"], [LIBS=$ac_getloadavg_LIBS])
+-fi
+-
+ # Make sure it is really in the library, if we think we found it,
+ # otherwise set up the replacement function.
+ AC_CHECK_FUNCS(getloadavg, [],
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
new file mode 100644
index 000000000..adb6ad7cc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb
@@ -0,0 +1,27 @@
+require autoconf.inc
+
+PR = "r11"
+
+LICENSE = "GPLv2 & GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+ file://COPYINGv3;md5=d32239bcb673463ab874e80d47fae504"
+SRC_URI += "file://autoreconf-include.patch \
+ file://check-automake-cross-warning.patch \
+ file://autoreconf-exclude.patch \
+ file://autoreconf-gnuconfigize.patch \
+ file://config_site.patch \
+ file://remove-usr-local-lib-from-m4.patch \
+ file://preferbash.patch \
+ file://autotest-automake-result-format.patch \
+ file://add_musl_config.patch \
+ file://performance.patch \
+ "
+
+SRC_URI[md5sum] = "82d05e03b93e45f5a39b828dc9c6c29b"
+SRC_URI[sha256sum] = "954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969"
+
+SRC_URI_append_class-native = " file://fix_path_xtra.patch"
+
+EXTRA_OECONF += "ac_cv_path_M4=m4 ac_cv_prog_TEST_EMACS=no"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.6.bb b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.6.bb
new file mode 100644
index 000000000..d77b8273e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen-native_5.18.6.bb
@@ -0,0 +1,36 @@
+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://redirect-output-dir.patch \
+"
+
+SRC_URI[md5sum] = "fdee403e524c0af3ded6b3becb365671"
+SRC_URI[sha256sum] = "2fc7f12a5ecb3b1e8bd4364aa906b837cff01f80edb7d2fb38ed8b9dfbcd3271"
+
+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/increase-timeout-limit.patch b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/increase-timeout-limit.patch
new file mode 100644
index 000000000..9efd7e558
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/increase-timeout-limit.patch
@@ -0,0 +1,30 @@
+Subject: [PATCH] autogen: increase timeout limit for shell commands
+
+On some overloaded hosts, shell commands of autogen may can not
+finish in 5 secs. This has caused many build failures, so increase
+the timeout limit to fix this.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
+---
+ configure.ac | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 58a848b..170dd9e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -178,9 +178,9 @@ time_delta=`expr ${config_end_time} - ${config_start_time} 2>/dev/null`
+ if test -z "${AG_TIMEOUT}"
+ then
+ if test -z "${time_delta}"
+- then time_delta=10
+- elif test ${time_delta} -lt 5
+- then time_delta=5 ; fi
++ then time_delta=60
++ elif test ${time_delta} -lt 30
++ then time_delta=30 ; fi
+
+ AG_TIMEOUT=${time_delta}
+ fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch
new file mode 100644
index 000000000..e56da7b1d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Pending
+
+mk-tpl-config.sh: force exit value to be 0 in subprocess
+
+The return value of statement list=`<subcommands>` is the exit value of the
+subcommands. So if the subcommands fails, the compilation fails. This is obviously
+not intended. In the normal case, we expect the grep command to fail as there should
+be no 'noreturn' word in the libguile files.
+
+Signed-off-by: Chen Qi <Qi.Chen@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 926f5ab..6b4a0fb 100755
+--- a/autoopts/mk-tpl-config.sh
++++ b/autoopts/mk-tpl-config.sh
+@@ -202,7 +202,7 @@ fix_guile() {
+
+ list=`set +e ; exec 2>/dev/null
+ find ${libguiledir}/libguile* -type f | \
+- xargs grep -l -E '\<noreturn\>'`
++ xargs grep -l -E '\<noreturn\>' ; exit 0`
+
+ test -z "$list" && exit 0
+
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/redirect-output-dir.patch b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/redirect-output-dir.patch
new file mode 100644
index 000000000..fc5a71b85
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/autogen/autogen/redirect-output-dir.patch
@@ -0,0 +1,28 @@
+[PATCH] redirect the dir of mklibsrc-log.tx
+
+Upstream-Status: Pending
+
+redirect mklibsrc-log.tx to builddir, not /tmp; otherwise mklibsrc-log.tx
+maybe unable to be written if other users is building autogen at the same time.
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ pkg/libopts/mklibsrc.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pkg/libopts/mklibsrc.sh b/pkg/libopts/mklibsrc.sh
+index 416b402..d612fbc 100644
+--- a/pkg/libopts/mklibsrc.sh
++++ b/pkg/libopts/mklibsrc.sh
+@@ -19,7 +19,7 @@
+ ## with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ set -ex
+-exec 2> /tmp/mklibsrc-log.tx
++exec 2> $top_builddir/mklibsrc-log.tx
+
+ top_builddir=`cd $top_builddir ; pwd`
+ top_srcdir=`cd $top_srcdir ; pwd`
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake.inc b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake.inc
new file mode 100644
index 000000000..4f9b5f774
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake.inc
@@ -0,0 +1,21 @@
+SUMMARY = "A GNU tool for automatically generating Makefiles"
+DESCRIPTION = "Automake is a tool for automatically generating `Makefile.in' files compliant with the GNU Coding \
+Standards. Automake requires the use of Autoconf."
+LICENSE = "GPLv2"
+HOMEPAGE = "http://www.gnu.org/software/automake/"
+SECTION = "devel"
+
+SRC_URI = "${GNU_MIRROR}/automake/automake-${PV}.tar.gz"
+
+inherit autotools texinfo
+
+do_configure() {
+ # We can end up patching macros, which would then mean autoreconf
+ # Cheat by saying everything is up to date.
+ touch ${S}/aclocal.m4 ${S}/Makefile.in ${S}/configure
+ oe_runconf
+}
+
+export AUTOMAKE = "${@bb.utils.which('automake', d.getVar('PATH', True))}"
+
+FILES_${PN} += "${datadir}/automake* ${datadir}/aclocal*"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/buildtest.patch b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/buildtest.patch
new file mode 100644
index 000000000..1dd533784
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/buildtest.patch
@@ -0,0 +1,33 @@
+Split "check-TESTS" into a buildtest and runtest target, so that they can
+be run separately.
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-Status: Pending
+
+--- a/lib/am/check.am 2012-11-14 13:46:16.335475995 +0100
++++ b/lib/am/check.am 2012-08-13 18:40:12.000000000 +0200
+@@ -44,7 +44,7 @@
+ am__tty_colors = $(am__tty_colors_dummy)
+ endif !%?COLOR%
+
+-.PHONY: check-TESTS
++.PHONY: check-TESTS buildtest-TESTS runtest-TESTS
+
+ if %?PARALLEL_TESTS%
+
+@@ -465,7 +465,14 @@
+
+ else !%?PARALLEL_TESTS%
+
+-check-TESTS: $(TESTS)
++AM_RECURSIVE_TARGETS += buildtest runtest
++
++buildtest-TESTS: $(TESTS)
++
++check-TESTS: buildtest-TESTS
++ $(MAKE) $(AM_MAKEFLAGS) runtest-TESTS
++
++runtest-TESTS:
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ ## Make sure Solaris VPATH-expands all members of this list, even
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/new_rt_path_for_test-driver.patch b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/new_rt_path_for_test-driver.patch
new file mode 100644
index 000000000..2c6594f52
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/new_rt_path_for_test-driver.patch
@@ -0,0 +1,36 @@
+Set relative to top_builddir path in Makefile to access test-driver
+
+Signed-off-by: Adrian Calianu <adrian.calianu@enea.com>
+Upstream-Status: Pending
+Bug-Report: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19042
+
+--- a/bin/automake.in
++++ b/bin/automake.in
+@@ -272,6 +272,9 @@
+ # $AM_CONFIG_AUX_DIR is prefixed with $(top_srcdir), so it can be used
+ # in Makefiles.
+ my $am_config_aux_dir = '';
++# Directory used at runtime like running test-driver that should not
++# depend on $(top_srcdir)
++my $am_config_rt_aux_dir = '';
+
+ # Directory to search for AC_LIBSOURCE files, as set by AC_CONFIG_LIBOBJ_DIR
+ # in configure.ac.
+@@ -4700,7 +4703,7 @@
+ {
+ require_conf_file ("parallel-tests", FOREIGN, 'test-driver');
+ define_variable ("${pfx}LOG_DRIVER",
+- "\$(SHELL) $am_config_aux_dir/test-driver",
++ "\$(SHELL) $am_config_rt_aux_dir/test-driver",
+ INTERNAL);
+ }
+ my $driver = '$(' . $pfx . 'LOG_DRIVER)';
+@@ -7284,6 +7287,10 @@
+ $am_config_aux_dir =
+ '$(top_srcdir)' . ($config_aux_dir eq '.' ? "" : "/$config_aux_dir");
+ $am_config_aux_dir =~ s,/*$,,;
++
++ $am_config_rt_aux_dir =
++ '$(top_builddir)' . ($config_aux_dir eq '.' ? "" : "/$config_aux_dir");
++ $am_config_rt_aux_dir =~ s,/*$,,;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/performance.patch b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/performance.patch
new file mode 100644
index 000000000..3e6d5694d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/performance.patch
@@ -0,0 +1,73 @@
+By default automake puts "sleep 1" into the start of configure scripts
+which adds pointless delays to them. Rather than do this, lets just assume
+our systems are sane.
+
+RP
+2015/12/7
+Upstream-Status: Inappropriate
+
+Index: automake-1.15/m4/sanity.m4
+===================================================================
+--- automake-1.15.orig/m4/sanity.m4
++++ automake-1.15/m4/sanity.m4
+@@ -23,60 +23,5 @@ case $srcdir in
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+ esac
+
+-# Do 'set' in a subshell so we don't clobber the current shell's
+-# arguments. Must try -L first in case configure is actually a
+-# symlink; some systems play weird games with the mod time of symlinks
+-# (eg FreeBSD returns the mod time of the symlink's containing
+-# directory).
+-if (
+- am_has_slept=no
+- for am_try in 1 2; do
+- echo "timestamp, slept: $am_has_slept" > conftest.file
+- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+- if test "$[*]" = "X"; then
+- # -L didn't work.
+- set X `ls -t "$srcdir/configure" conftest.file`
+- fi
+- if test "$[*]" != "X $srcdir/configure conftest.file" \
+- && test "$[*]" != "X conftest.file $srcdir/configure"; then
+-
+- # If neither matched, then we have a broken ls. This can happen
+- # if, for instance, CONFIG_SHELL is bash and it inherits a
+- # broken ls alias from the environment. This has actually
+- # happened. Such a system could not be considered "sane".
+- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+- alias in your environment])
+- fi
+- if test "$[2]" = conftest.file || test $am_try -eq 2; then
+- break
+- fi
+- # Just in case.
+- sleep 1
+- am_has_slept=yes
+- done
+- test "$[2]" = conftest.file
+- )
+-then
+- # Ok.
+- :
+-else
+- AC_MSG_ERROR([newly created file is older than distributed files!
+-Check your system clock])
+-fi
+ AC_MSG_RESULT([yes])
+-# If we didn't sleep, we still need to ensure time stamps of config.status and
+-# generated files are strictly newer.
+-am_sleep_pid=
+-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+- ( sleep 1 ) &
+- am_sleep_pid=$!
+-fi
+-AC_CONFIG_COMMANDS_PRE(
+- [AC_MSG_CHECKING([that generated files are newer than configure])
+- if test -n "$am_sleep_pid"; then
+- # Hide warnings about reused PIDs.
+- wait $am_sleep_pid 2>/dev/null
+- fi
+- AC_MSG_RESULT([done])])
+-rm -f conftest.file
+ ])
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/python-libdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/python-libdir.patch
new file mode 100644
index 000000000..47541bded
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/python-libdir.patch
@@ -0,0 +1,65 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+Updated for automake-1.12.6
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+diff -Nurd automake-1.12.6/m4/python.m4 automake-1.12.6/m4/python.m4
+--- automake-1.12.6/m4/python.m4 2012-12-13 22:02:25.000000000 +0200
++++ automake-1.12.6/m4/python.m4 2012-12-27 17:40:26.558164660 +0200
+@@ -91,12 +91,13 @@
+ [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
+ AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
+
+- dnl Use the values of $prefix and $exec_prefix for the corresponding
+- dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
++ dnl Use the values of $prefix, $libdir and $exec_prefix for the corresponding
++ dnl values of PYTHON_PREFIX PYTHON_LIB_PREFIX, and PYTHON_EXEC_PREFIX. These are made
+ dnl distinct variables so they can be overridden if need be. However,
+ dnl general consensus is that you shouldn't need this ability.
+
+ AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
++ AC_SUBST([PYTHON_LIB_PREFIX], ['${libdir}'])
+ AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
+
+ dnl At times (like when building shared libraries) you may want
+@@ -148,7 +149,8 @@
+ else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
+-sys.stdout.write(sitedir)"`
++sys.stdout.write(sitedir)" ||
++ echo "$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages"`
+ case $am_cv_python_pythondir in
+ $am_py_prefix*)
+ am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
+@@ -158,7 +160,7 @@
+ case $am_py_prefix in
+ /usr|/System*) ;;
+ *)
+- am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
++ am_cv_python_pythondir=$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages
+ ;;
+ esac
+ ;;
+@@ -190,7 +192,8 @@
+ else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
+-sys.stdout.write(sitedir)"`
++sys.stdout.write(sitedir)" ||
++ echo "$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages"`
+ case $am_cv_python_pyexecdir in
+ $am_py_exec_prefix*)
+ am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
+@@ -200,7 +203,7 @@
+ case $am_py_exec_prefix in
+ /usr|/System*) ;;
+ *)
+- am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
++ am_cv_python_pyexecdir=$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages
+ ;;
+ esac
+ ;;
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
new file mode 100644
index 000000000..a3c72fd33
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb
@@ -0,0 +1,35 @@
+require automake.inc
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+DEPENDS_class-native = "autoconf-native"
+
+NAMEVER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+RDEPENDS_${PN} += "\
+ autoconf \
+ perl \
+ perl-module-bytes \
+ perl-module-data-dumper \
+ perl-module-strict \
+ perl-module-text-parsewords \
+ perl-module-thread-queue \
+ perl-module-threads \
+ perl-module-vars "
+
+RDEPENDS_${PN}_class-native = "autoconf-native hostperl-runtime-native"
+
+SRC_URI += " file://python-libdir.patch \
+ file://buildtest.patch \
+ file://performance.patch \
+ file://new_rt_path_for_test-driver.patch"
+
+SRC_URI[md5sum] = "716946a105ca228ab545fc37a70df3a3"
+SRC_URI[sha256sum] = "7946e945a96e28152ba5a6beb0625ca715c6e32ac55f2e353ef54def0c8ed924"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL=${USRBINPATH}/perl"
+
+do_install_append () {
+ install -d ${D}${datadir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.26.inc b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.26.inc
new file mode 100644
index 000000000..6d535fcaa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.26.inc
@@ -0,0 +1,42 @@
+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 = "71fa566a9cf2597b60a58c1d7c148bab637454a6"
+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-GOT-address-computations-in-initial-PLT-entries-.patch \
+ file://0014-Correct-nios2-_gp-address-computation.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
new file mode 100644
index 000000000..ae1464227
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
@@ -0,0 +1,29 @@
+inherit cross-canadian
+
+SUMMARY = "GNU binary utilities (cross-canadian for ${TARGET_ARCH} target)"
+PN = "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+BPN = "binutils"
+
+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} \
+ "
+
+# 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"
+
+do_install () {
+ autotools_do_install
+
+ # We're not interested in the libs or headers, these would come from the
+ # nativesdk or target version of the binutils recipe
+ rm -rf ${D}${prefix}/${TARGET_SYS}
+ rm -f ${D}${libdir}/libbfd*
+ rm -f ${D}${libdir}/libiberty*
+ rm -f ${D}${libdir}/libopcodes*
+ rm -f ${D}${includedir}/*.h
+
+ cross_canadian_bindirlinks
+}
+
+BBCLASSEXTEND = ""
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.26.bb b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.26.bb
new file mode 100644
index 000000000..5dbaa0301
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.26.bb
@@ -0,0 +1,3 @@
+require binutils.inc
+require binutils-${PV}.inc
+require binutils-cross-canadian.inc
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
new file mode 100644
index 000000000..fd3d80149
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross.inc
@@ -0,0 +1,30 @@
+inherit cross
+PROVIDES = "virtual/${TARGET_PREFIX}binutils"
+
+PN = "binutils-cross-${TARGET_ARCH}"
+BPN = "binutils"
+
+INHIBIT_DEFAULT_DEPS = "1"
+INHIBIT_AUTOTOOLS_DEPS = "1"
+
+EXTRA_OECONF += "--with-sysroot=${STAGING_DIR_TARGET} \
+ --disable-install-libbfd \
+ --enable-poison-system-directories \
+ "
+do_install () {
+ oe_runmake 'DESTDIR=${D}' install
+
+ # We don't really need these, so we'll remove them...
+ rm -rf ${D}${STAGING_DIR_NATIVE}${libdir_native}/libiberty.a
+ rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}
+ rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/lib/ldscripts
+ rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/info
+ rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/locale
+ rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/man
+ rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/share || :
+ rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}/gcc-lib || :
+ rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64/gcc-lib || :
+ rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir} || :
+ rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64 || :
+ rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${prefix} || :
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross_2.26.bb b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross_2.26.bb
new file mode 100644
index 000000000..fbd1f7d25
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-cross_2.26.bb
@@ -0,0 +1,3 @@
+require binutils.inc
+require binutils-${PV}.inc
+require binutils-cross.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.26.bb b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.26.bb
new file mode 100644
index 000000000..788106f9e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.26.bb
@@ -0,0 +1,13 @@
+require binutils-cross_${PV}.bb
+
+inherit crosssdk
+
+PN = "binutils-crosssdk-${TARGET_ARCH}"
+
+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.inc b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils.inc
new file mode 100644
index 000000000..43e2aa232
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils.inc
@@ -0,0 +1,162 @@
+SUMMARY = "GNU binary utilities"
+DESCRIPTION = "The GNU Binutils are a collection of binary tools. \
+The main ones are ld (GNU Linker), and as (GNU Assembler). This \
+package also includes addition tools such as addr2line (Converts \
+addresses into filenames and line numbers), ar (utility for creating, \
+modifying and extracting archives), nm (list symbols in object \
+files), objcopy (copy and translate object files), objdump (Display \
+object information), and other tools and related libraries."
+HOMEPAGE = "http://www.gnu.org/software/binutils/"
+BUGTRACKER = "http://sourceware.org/bugzilla/"
+SECTION = "devel"
+LICENSE = "GPLv3"
+
+DEPENDS = "flex-native bison-native zlib-native gnu-config-native autoconf-native"
+
+#
+# we need chrpath > 0.14 and some distros like centos 7 still have older chrpath
+#
+DEPENDS_append_class-target = " chrpath-replacement-native"
+EXTRANATIVEPATH_append_class-target = " chrpath-native"
+
+inherit autotools gettext multilib_header texinfo
+
+FILES_${PN} = " \
+ ${bindir}/${TARGET_PREFIX}* \
+ ${libdir}/lib*-*.so \
+ ${prefix}/${TARGET_SYS}/bin/* \
+ ${bindir}/embedspu"
+
+RPROVIDES_${PN} += "${PN}-symlinks"
+
+FILES_${PN}-dev = " \
+ ${includedir} \
+ ${libdir}/*.la \
+ ${libdir}/libbfd.so \
+ ${libdir}/libopcodes.so"
+
+# Rather than duplicating multiple entries for these, make one
+# list and reuse it.
+
+USE_ALTERNATIVES_FOR = " \
+ addr2line \
+ ar \
+ as \
+ c++filt \
+ elfedit \
+ gprof \
+ ld \
+ ld.bfd \
+ ld.gold dwp \
+ nm \
+ objcopy \
+ objdump \
+ ranlib \
+ readelf \
+ size \
+ strings \
+ strip \
+"
+USE_ALTERNATIVES_FOR_remove_mips = "ld.gold dwp"
+
+python do_package_prepend() {
+ make_alts = d.getVar("USE_ALTERNATIVES_FOR", True) or ""
+ prefix = d.getVar("TARGET_PREFIX", True)
+ bindir = d.getVar("bindir", True)
+ for alt in make_alts.split():
+ d.setVarFlag('ALTERNATIVE_TARGET', alt, bindir + "/" + prefix + alt)
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', alt, bindir + "/" + alt)
+}
+
+B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
+
+EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
+ --disable-werror \
+ --enable-plugins \
+ ${LDGOLD} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}"
+
+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)}"
+
+# This is necessary due to a bug in the binutils Makefiles
+# EXTRA_OEMAKE = "configure-build-libiberty all"
+
+export AR = "${HOST_PREFIX}ar"
+export AS = "${HOST_PREFIX}as"
+export LD = "${HOST_PREFIX}ld"
+export NM = "${HOST_PREFIX}nm"
+export RANLIB = "${HOST_PREFIX}ranlib"
+export OBJCOPY = "${HOST_PREFIX}objcopy"
+export OBJDUMP = "${HOST_PREFIX}objdump"
+
+export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
+export AS_FOR_TARGET = "${TARGET_PREFIX}as"
+export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
+export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
+export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
+
+export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
+export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
+
+# autotools.bbclass sets the _FOR_BUILD variables, but for some reason we need
+# to unset LD_LIBRARY_PATH.
+export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}"
+
+MULTIARCH := "${@bb.utils.contains("DISTRO_FEATURES", "multiarch", "yes", "no", d)}"
+do_configure[vardeps] += "MULTIARCH"
+do_configure () {
+ (cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
+ oe_runconf
+#
+# must prime config.cache to ensure the build of libiberty
+#
+ mkdir -p ${B}/build-${BUILD_SYS}
+ for i in ${CONFIG_SITE}; do
+ cat $i >> ${B}/build-${BUILD_SYS}/config.cache || true
+ done
+}
+
+do_compile_append_class-target() {
+ chrpath -d ${B}/binutils/elfedit
+ chrpath -d ${B}/binutils/readelf
+}
+do_install () {
+ autotools_do_install
+
+ # We don't really need these, so we'll remove them...
+ rm -rf ${D}${libdir}/ldscripts
+
+ # Fix the /usr/${TARGET_SYS}/bin/* links
+ for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
+ rm -f $l
+ ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
+ | tr -s / \
+ | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
+ done
+
+ # Install the libiberty header
+ install -d ${D}${includedir}
+ install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
+ install -m 644 ${S}/include/libiberty.h ${D}${includedir}
+
+ cd ${D}${bindir}
+
+ # Symlinks for ease of running these on the native target
+ for p in ${TARGET_PREFIX}* ; do
+ ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,`
+ done
+
+ for alt in ${USE_ALTERNATIVES_FOR}; do
+ rm -f ${D}${bindir}/$alt
+ done
+
+ oe_multilib_header bfd.h
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN}_class-target = "${USE_ALTERNATIVES_FOR}"
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
new file mode 100644
index 000000000..91f901761
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-Generate-relocatable-SDKs.patch
@@ -0,0 +1,62 @@
+From 3c75355342a8562ccb65b8bbbe81a0495fec5c57 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/14] 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 a84d233..d12c4e2 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 ec78c90..f9e7a31 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.7.1
+
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
new file mode 100644
index 000000000..4a202d047
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0002-configure-widen-the-regexp-for-SH-architectures.patch
@@ -0,0 +1,56 @@
+From b1ae604880562ed065f614a745d3f8922838bc5a 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/14] 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 34b66f7..85414ab 100755
+--- a/configure
++++ b/configure
+@@ -3445,7 +3445,7 @@ case "${target}" in
+ ;;
+ s390-*-* | s390x-*-*)
+ ;;
+- sh-*-* | sh[34]*-*-*)
++ sh*-*-* | sh[34]*-*-*)
+ ;;
+ sh64-*-* | sh5*-*-*)
+ ;;
+@@ -3939,7 +3939,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 693b927..d4db554 100755
+--- a/gprof/configure
++++ b/gprof/configure
+@@ -5869,6 +5869,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.7.1
+
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
new file mode 100644
index 000000000..2c70ecd93
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0003-Point-scripts-location-to-libdir.patch
@@ -0,0 +1,42 @@
+From 01808e8ef8ee709c8218d962601c18a63a063a1f 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/14] 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 0b3b049..3871c74 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 ed98f87..530e4c9 100644
+--- a/ld/Makefile.in
++++ b/ld/Makefile.in
+@@ -413,7 +413,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.7.1
+
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
new file mode 100644
index 000000000..8f0a40210
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
@@ -0,0 +1,41 @@
+From c008c7f97c1cf487749c6c375820a1f3b3c6c53d 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/14] 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 0405d4f..73c5447 100644
+--- a/ld/emultempl/elf32.em
++++ b/ld/emultempl/elf32.em
+@@ -1242,6 +1242,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;
+@@ -1523,6 +1525,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.7.1
+
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
new file mode 100644
index 000000000..92ead7fb4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0005-Explicitly-link-with-libm-on-uclibc.patch
@@ -0,0 +1,52 @@
+From 6a41635e29c4a6c064b1f66e79a8fe2026f4361b 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/14] 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 0b490d4..086e0d2 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.7.1
+
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
new file mode 100644
index 000000000..e54ab1bc8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch
@@ -0,0 +1,21295 @@
+From da70f0876cdd8ed703d9ed1524212ccfefb09ef3 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/14] Use libtool 2.4
+
+get libtool sysroot support
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ bfd/configure | 1322 +++++++++++++++++------
+ bfd/configure.ac | 2 +-
+ binutils/configure | 1320 +++++++++++++++++------
+ configure | 4 +-
+ gas/configure | 1320 +++++++++++++++++------
+ gprof/configure | 1325 +++++++++++++++++------
+ ld/configure | 1695 +++++++++++++++++++++--------
+ libtool.m4 | 1080 +++++++++++++------
+ ltmain.sh | 2925 +++++++++++++++++++++++++++++++++-----------------
+ ltoptions.m4 | 2 +-
+ ltversion.m4 | 12 +-
+ lt~obsolete.m4 | 2 +-
+ opcodes/configure | 1322 +++++++++++++++++------
+ opcodes/configure.ac | 2 +-
+ zlib/configure | 1320 +++++++++++++++++------
+ 15 files changed, 9944 insertions(+), 3709 deletions(-)
+
+diff --git a/bfd/configure b/bfd/configure
+index 7411c6d..eae743e 100755
+--- a/bfd/configure
++++ b/bfd/configure
+@@ -670,6 +670,9 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
++ac_ct_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
+@@ -1458,6 +1462,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
+@@ -5388,8 +5394,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -5429,7 +5435,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
+@@ -6115,8 +6121,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
+@@ -6165,6 +6171,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 :
+@@ -6181,6 +6261,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'
+@@ -6349,7 +6434,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
+ ;;
+@@ -6503,6 +6589,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
+@@ -6518,9 +6619,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 :
+@@ -6536,7 +6790,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
+@@ -6556,11 +6810,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 :
+@@ -6576,7 +6834,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
+@@ -6595,6 +6853,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
+@@ -6606,16 +6868,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
+
+
+
+@@ -6957,8 +7275,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=
+@@ -6994,6 +7312,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
+@@ -7035,6 +7354,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
+@@ -7046,7 +7377,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;
+ }
+@@ -7072,8 +7403,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
+@@ -7083,8 +7414,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
+@@ -7121,6 +7452,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
++
++
++
++
+
+
+
+@@ -7142,6 +7483,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;
+@@ -7348,6 +7728,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*)
+@@ -7911,6 +8408,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
+@@ -8075,7 +8574,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -8164,7 +8664,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,
+@@ -8462,8 +8962,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,'
+@@ -8629,6 +9127,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)
+@@ -8691,7 +9195,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,';;
+@@ -8748,13 +9252,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.
+@@ -8815,6 +9323,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -9165,7 +9678,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'
+@@ -9264,12 +9778,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
+@@ -9283,8 +9797,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
+ ;;
+
+@@ -9302,8 +9816,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
+@@ -9349,8 +9863,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
+@@ -9480,7 +9994,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
+@@ -9493,22 +10013,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"
+@@ -9520,7 +10047,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
+@@ -9533,22 +10066,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,
+@@ -9593,20 +10133,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*)
+@@ -9667,7 +10250,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
+@@ -9675,7 +10258,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
+@@ -9691,7 +10274,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
+@@ -9715,10 +10298,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
+@@ -9797,23 +10380,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'
+@@ -9898,7 +10494,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 \*'
+@@ -9917,9 +10513,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"*)
+@@ -10495,8 +11091,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}`~
+@@ -10529,13 +11126,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
+ ;;
+@@ -10627,7 +11282,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
+ ;;
+
+@@ -11423,7 +12078,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11426 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11467,10 +12122,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);
+@@ -11529,7 +12184,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11532 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11573,10 +12228,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);
+@@ -15121,7 +15776,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.
+@@ -16746,13 +17401,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"`'
+@@ -16767,14 +17429,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"`'
+@@ -16807,12 +17472,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"`'
+@@ -16867,8 +17532,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 \
+@@ -16878,12 +17548,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 \
+@@ -16899,7 +17571,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 \
+@@ -16935,6 +17606,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -17714,7 +18386,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.
+@@ -17817,19 +18490,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
+
+@@ -17859,6 +18555,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
+
+@@ -17868,6 +18570,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
+
+@@ -17982,12 +18687,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
+
+@@ -18074,9 +18779,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
+
+@@ -18092,6 +18794,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
+
+@@ -18124,210 +18829,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 6f5e85f..44bd02c 100644
+--- a/bfd/configure.ac
++++ b/bfd/configure.ac
+@@ -567,7 +567,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 d4f3e1e..a6df5bb 100755
+--- a/binutils/configure
++++ b/binutils/configure
+@@ -657,8 +657,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -769,6 +772,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1441,6 +1445,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
+@@ -5155,8 +5161,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -5196,7 +5202,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
+@@ -5882,8 +5888,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
+@@ -5932,6 +5938,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 :
+@@ -5948,6 +6028,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'
+@@ -6116,7 +6201,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
+ ;;
+@@ -6270,6 +6356,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
+@@ -6285,9 +6386,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 :
+@@ -6303,7 +6557,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
+@@ -6323,11 +6577,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 :
+@@ -6343,7 +6601,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
+@@ -6362,6 +6620,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
+@@ -6373,12 +6635,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}
+
+
+
+@@ -6390,6 +6650,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
+@@ -6724,8 +7042,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=
+@@ -6761,6 +7079,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
+@@ -6802,6 +7121,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
+@@ -6813,7 +7144,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;
+ }
+@@ -6839,8 +7170,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
+@@ -6850,8 +7181,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
+@@ -6888,6 +7219,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
++
++
++
++
++
++
++
++
++
+
+
+
+@@ -6906,6 +7252,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; }
++
++
+
+
+
+@@ -7115,6 +7495,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*)
+@@ -7678,6 +8175,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
+@@ -7873,7 +8372,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7962,7 +8462,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,
+@@ -8260,8 +8760,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,'
+@@ -8427,6 +8925,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)
+@@ -8489,7 +8993,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,';;
+@@ -8546,13 +9050,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.
+@@ -8613,6 +9121,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8963,7 +9476,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'
+@@ -9062,12 +9576,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
+@@ -9081,8 +9595,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
+ ;;
+
+@@ -9100,8 +9614,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
+@@ -9147,8 +9661,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
+@@ -9278,7 +9792,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
+@@ -9291,22 +9811,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"
+@@ -9318,7 +9845,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
+@@ -9331,22 +9864,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,
+@@ -9391,20 +9931,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*)
+@@ -9465,7 +10048,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
+@@ -9473,7 +10056,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
+@@ -9489,7 +10072,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
+@@ -9513,10 +10096,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
+@@ -9595,23 +10178,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'
+@@ -9696,7 +10292,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 \*'
+@@ -9715,9 +10311,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"*)
+@@ -10293,8 +10889,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}`~
+@@ -10327,13 +10924,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
+ ;;
+@@ -10425,7 +11080,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
+ ;;
+
+@@ -11221,7 +11876,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11224 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11265,10 +11920,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);
+@@ -11327,7 +11982,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11330 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11371,10 +12026,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);
+@@ -15355,13 +16010,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"`'
+@@ -15376,14 +16038,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"`'
+@@ -15416,12 +16081,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"`'
+@@ -15476,8 +16141,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 \
+@@ -15487,12 +16157,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 \
+@@ -15508,7 +16180,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 \
+@@ -15544,6 +16215,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -16301,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.
+@@ -16404,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
+
+@@ -16446,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
+
+@@ -16455,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
+
+@@ -16569,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
+
+@@ -16661,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
+
+@@ -16679,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
+
+@@ -16711,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/configure b/configure
+index 85414ab..34b66f7 100755
+--- a/configure
++++ b/configure
+@@ -3445,7 +3445,7 @@ case "${target}" in
+ ;;
+ s390-*-* | s390x-*-*)
+ ;;
+- sh*-*-* | sh[34]*-*-*)
++ sh-*-* | sh[34]*-*-*)
+ ;;
+ sh64-*-* | sh5*-*-*)
+ ;;
+@@ -3939,7 +3939,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 dd9c953..89f18b3 100755
+--- a/gas/configure
++++ b/gas/configure
+@@ -647,8 +647,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -759,6 +762,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1430,6 +1434,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
+
+ Some influential environment variables:
+@@ -4909,8 +4915,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -4950,7 +4956,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
+@@ -5636,8 +5642,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
+@@ -5686,6 +5692,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 :
+@@ -5702,6 +5782,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'
+@@ -5870,7 +5955,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
+ ;;
+@@ -6024,6 +6110,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
+@@ -6039,9 +6140,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 :
+@@ -6057,7 +6311,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
+@@ -6077,11 +6331,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 :
+@@ -6097,7 +6355,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
+@@ -6116,6 +6374,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
+@@ -6127,12 +6389,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}
+
+
+
+@@ -6144,6 +6404,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
+@@ -6478,8 +6796,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=
+@@ -6515,6 +6833,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
+@@ -6556,6 +6875,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
+@@ -6567,7 +6898,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;
+ }
+@@ -6593,8 +6924,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
+@@ -6604,8 +6935,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
+@@ -6642,6 +6973,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
++
++
++
++
++
++
++
++
++
+
+
+
+@@ -6660,6 +7006,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; }
++
++
+
+
+
+@@ -6869,6 +7249,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*)
+@@ -7432,6 +7929,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
+@@ -7627,7 +8126,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7716,7 +8216,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,
+@@ -8014,8 +8514,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,'
+@@ -8181,6 +8679,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)
+@@ -8243,7 +8747,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,';;
+@@ -8300,13 +8804,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.
+@@ -8367,6 +8875,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8717,7 +9230,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'
+@@ -8816,12 +9330,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
+@@ -8835,8 +9349,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
+ ;;
+
+@@ -8854,8 +9368,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
+@@ -8901,8 +9415,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
+@@ -9032,7 +9546,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
+@@ -9045,22 +9565,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"
+@@ -9072,7 +9599,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
+@@ -9085,22 +9618,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,
+@@ -9145,20 +9685,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*)
+@@ -9219,7 +9802,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
+@@ -9227,7 +9810,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
+@@ -9243,7 +9826,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
+@@ -9267,10 +9850,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
+@@ -9349,23 +9932,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'
+@@ -9450,7 +10046,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 \*'
+@@ -9469,9 +10065,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"*)
+@@ -10047,8 +10643,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}`~
+@@ -10081,13 +10678,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
+ ;;
+@@ -10179,7 +10834,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
+ ;;
+
+@@ -10975,7 +11630,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10978 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11019,10 +11674,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);
+@@ -11081,7 +11736,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11084 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11125,10 +11780,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);
+@@ -15276,13 +15931,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"`'
+@@ -15297,14 +15959,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"`'
+@@ -15337,12 +16002,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"`'
+@@ -15397,8 +16062,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 \
+@@ -15408,12 +16078,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 \
+@@ -15429,7 +16101,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 \
+@@ -15465,6 +16136,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -16229,7 +16901,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.
+@@ -16332,19 +17005,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
+
+@@ -16374,6 +17070,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
+
+@@ -16383,6 +17085,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
+
+@@ -16497,12 +17202,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
+
+@@ -16589,9 +17294,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
+
+@@ -16607,6 +17309,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
+
+@@ -16639,210 +17344,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 d4db554..78b292c 100755
+--- a/gprof/configure
++++ b/gprof/configure
+@@ -629,8 +629,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -741,6 +744,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1399,6 +1403,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
+@@ -4831,8 +4837,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -4872,7 +4878,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
+@@ -5558,8 +5564,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
+@@ -5608,6 +5614,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 :
+@@ -5624,6 +5704,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'
+@@ -5792,7 +5877,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
+ ;;
+@@ -5869,11 +5955,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)$'
+@@ -5951,6 +6032,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
+@@ -5966,9 +6062,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 :
+@@ -5984,7 +6233,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
+@@ -6004,11 +6253,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 :
+@@ -6024,7 +6277,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
+@@ -6043,6 +6296,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
+@@ -6054,12 +6311,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}
+
+
+
+@@ -6071,6 +6326,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
+@@ -6405,8 +6718,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=
+@@ -6442,6 +6755,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
+@@ -6483,6 +6797,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
+@@ -6494,7 +6820,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;
+ }
+@@ -6520,8 +6846,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
+@@ -6531,8 +6857,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
+@@ -6569,6 +6895,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
++
++
++
++
++
++
+
+
+
+@@ -6590,6 +6928,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;
+@@ -6796,6 +7171,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*)
+@@ -7359,6 +7851,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
+@@ -7554,7 +8048,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7643,7 +8138,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,
+@@ -7941,8 +8436,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,'
+@@ -8108,6 +8601,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)
+@@ -8170,7 +8669,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,';;
+@@ -8227,13 +8726,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.
+@@ -8294,6 +8797,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8644,7 +9152,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'
+@@ -8743,12 +9252,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
+@@ -8762,8 +9271,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
+ ;;
+
+@@ -8781,8 +9290,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
+@@ -8828,8 +9337,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
+@@ -8959,7 +9468,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
+@@ -8972,22 +9487,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"
+@@ -8999,7 +9521,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
+@@ -9012,22 +9540,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,
+@@ -9072,20 +9607,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*)
+@@ -9146,7 +9724,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
+@@ -9154,7 +9732,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
+@@ -9170,7 +9748,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
+@@ -9194,10 +9772,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
+@@ -9276,23 +9854,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'
+@@ -9377,7 +9968,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 \*'
+@@ -9396,9 +9987,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"*)
+@@ -9974,8 +10565,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}`~
+@@ -10008,13 +10600,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
+ ;;
+@@ -10106,7 +10756,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
+ ;;
+
+@@ -10902,7 +11552,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10900 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10946,10 +11596,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);
+@@ -11008,7 +11658,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11006 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11052,10 +11702,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);
+@@ -12924,13 +13574,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"`'
+@@ -12945,14 +13602,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"`'
+@@ -12985,12 +13645,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"`'
+@@ -13045,8 +13705,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 \
+@@ -13056,12 +13721,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 \
+@@ -13077,7 +13744,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 \
+@@ -13113,6 +13779,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -13869,7 +14536,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.
+@@ -13972,19 +14640,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
+
+@@ -14014,6 +14705,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
+
+@@ -14023,6 +14720,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
+
+@@ -14137,12 +14837,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
+
+@@ -14229,9 +14929,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
+
+@@ -14247,6 +14944,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
+
+@@ -14279,210 +14979,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 8095b71..eb4f0d7 100755
+--- a/ld/configure
++++ b/ld/configure
+@@ -657,8 +657,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -779,6 +782,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1458,6 +1462,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.
+
+@@ -5649,8 +5655,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -5690,7 +5696,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
+@@ -6376,8 +6382,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
+@@ -6426,6 +6432,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 :
+@@ -6442,6 +6522,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'
+@@ -6610,7 +6695,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
+ ;;
+@@ -6764,6 +6850,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
+@@ -6779,9 +6880,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 :
+@@ -6797,7 +7051,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
+@@ -6817,11 +7071,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 :
+@@ -6837,7 +7095,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
+@@ -6856,6 +7114,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
+@@ -6867,12 +7129,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}
++
++
+
+
+
+@@ -6882,6 +7144,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
+@@ -7218,8 +7536,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=
+@@ -7255,6 +7573,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
+@@ -7296,6 +7615,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
+@@ -7307,7 +7638,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;
+ }
+@@ -7333,8 +7664,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
+@@ -7344,8 +7675,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
+@@ -7382,6 +7713,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
++
++
++
++
++
++
++
+
+
+
+@@ -7402,6 +7746,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 :
+@@ -7609,6 +7989,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*)
+@@ -8172,6 +8669,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
+@@ -8240,6 +8739,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
+@@ -8368,7 +8877,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -8457,7 +8967,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,
+@@ -8755,8 +9265,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,'
+@@ -8922,6 +9430,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)
+@@ -8984,7 +9498,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,';;
+@@ -9041,13 +9555,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.
+@@ -9108,6 +9626,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -9458,7 +9981,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'
+@@ -9557,12 +10081,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
+@@ -9576,8 +10100,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
+ ;;
+
+@@ -9595,8 +10119,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
+@@ -9642,8 +10166,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
+@@ -9773,7 +10297,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
+@@ -9786,22 +10316,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"
+@@ -9813,7 +10350,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
+@@ -9826,22 +10369,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,
+@@ -9885,21 +10435,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*)
+@@ -9960,7 +10553,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
+@@ -9968,7 +10561,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
+@@ -9984,7 +10577,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
+@@ -10008,10 +10601,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
+@@ -10090,23 +10683,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'
+@@ -10191,7 +10797,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 \*'
+@@ -10210,9 +10816,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"*)
+@@ -10788,8 +11394,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}`~
+@@ -10822,13 +11429,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
+ ;;
+@@ -10920,7 +11585,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
+ ;;
+
+@@ -11716,7 +12381,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11719 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11760,10 +12425,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);
+@@ -11822,7 +12487,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11825 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11866,10 +12531,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);
+@@ -12261,6 +12926,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
+@@ -12278,6 +12944,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
+@@ -12560,7 +13227,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
+@@ -12573,22 +13246,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"
+
+@@ -12601,7 +13281,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
+@@ -12614,22 +13300,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,
+@@ -12672,29 +13365,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*)
+
+
+@@ -12800,7 +13539,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
+@@ -12871,10 +13610,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
+@@ -12915,9 +13654,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
+@@ -12987,20 +13726,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'
+@@ -13195,7 +13934,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
+
+@@ -13241,7 +13980,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'
+@@ -13282,9 +14021,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
+@@ -13419,6 +14158,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=$?
+@@ -13432,7 +14178,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.
+@@ -13441,13 +14187,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.
+@@ -13467,8 +14222,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.
+@@ -13504,6 +14261,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
+@@ -13539,7 +14297,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
+@@ -13604,8 +14362,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
+@@ -13710,6 +14466,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++*)
+@@ -13862,7 +14623,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'
+@@ -13927,10 +14688,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.
+@@ -13988,6 +14756,8 @@ fi
+
+
+
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -14165,6 +14935,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.
+@@ -14179,15 +14950,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; }
+@@ -14450,8 +15226,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}`~
+@@ -14483,13 +15260,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
+ ;;
+@@ -14580,7 +15415,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
+ ;;
+
+@@ -15039,6 +15874,7 @@ fi
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
++ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+@@ -17953,13 +18789,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"`'
+@@ -17974,14 +18817,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"`'
+@@ -18014,12 +18860,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"`'
+@@ -18058,8 +18904,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"`'
+@@ -18086,12 +18932,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"`'
+@@ -18129,8 +18975,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 \
+@@ -18140,12 +18991,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 \
+@@ -18161,7 +19014,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 \
+@@ -18183,8 +19035,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 \
+@@ -18196,7 +19048,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 \
+@@ -18230,6 +19081,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -18244,7 +19096,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\\"\\\`\\\\\\""
+@@ -19037,7 +19890,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.
+@@ -19140,19 +19994,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
+
+@@ -19182,6 +20059,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
+
+@@ -19191,6 +20074,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
+
+@@ -19305,12 +20191,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
+
+@@ -19397,9 +20283,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
+
+@@ -19415,6 +20298,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
+
+@@ -19461,210 +20347,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"
+
+@@ -19692,12 +20537,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
+
+@@ -19784,9 +20629,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
+
+@@ -19802,6 +20644,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 4b2d30a..008d331 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_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 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 eedb184..d3076e1 100755
+--- a/opcodes/configure
++++ b/opcodes/configure
+@@ -648,6 +648,9 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
++ac_ct_AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -760,6 +763,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_targets
+ enable_werror
+@@ -1420,6 +1424,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
+@@ -5110,8 +5116,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -5151,7 +5157,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
+@@ -5837,8 +5843,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
+@@ -5887,6 +5893,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 :
+@@ -5903,6 +5983,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'
+@@ -6071,7 +6156,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
+ ;;
+@@ -6225,6 +6311,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
+@@ -6240,9 +6341,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 :
+@@ -6258,7 +6512,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
+@@ -6278,11 +6532,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 :
+@@ -6298,7 +6556,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
+@@ -6317,6 +6575,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
+@@ -6328,16 +6590,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
+
+
+
+@@ -6679,8 +6997,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=
+@@ -6716,6 +7034,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
+@@ -6757,6 +7076,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
+@@ -6768,7 +7099,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;
+ }
+@@ -6794,8 +7125,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
+@@ -6805,8 +7136,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
+@@ -6843,6 +7174,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
++
++
++
++
+
+
+
+@@ -6864,6 +7205,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;
+@@ -7070,6 +7450,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*)
+@@ -7633,6 +8130,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
+@@ -7798,7 +8297,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7887,7 +8387,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,
+@@ -8185,8 +8685,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,'
+@@ -8352,6 +8850,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)
+@@ -8414,7 +8918,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,';;
+@@ -8471,13 +8975,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.
+@@ -8538,6 +9046,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8888,7 +9401,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'
+@@ -8987,12 +9501,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
+@@ -9006,8 +9520,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
+ ;;
+
+@@ -9025,8 +9539,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
+@@ -9072,8 +9586,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
+@@ -9203,7 +9717,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
+@@ -9216,22 +9736,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"
+@@ -9243,7 +9770,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
+@@ -9256,22 +9789,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,
+@@ -9316,20 +9856,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*)
+@@ -9390,7 +9973,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
+@@ -9398,7 +9981,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
+@@ -9414,7 +9997,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
+@@ -9438,10 +10021,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
+@@ -9520,23 +10103,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'
+@@ -9621,7 +10217,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 \*'
+@@ -9640,9 +10236,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"*)
+@@ -10218,8 +10814,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}`~
+@@ -10252,13 +10849,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
+ ;;
+@@ -10350,7 +11005,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
+ ;;
+
+@@ -11146,7 +11801,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11149 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11190,10 +11845,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);
+@@ -11252,7 +11907,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 11255 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11296,10 +11951,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);
+@@ -12462,7 +13117,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
+@@ -13436,13 +14091,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"`'
+@@ -13457,14 +14119,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"`'
+@@ -13497,12 +14162,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"`'
+@@ -13557,8 +14222,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 \
+@@ -13568,12 +14238,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 \
+@@ -13589,7 +14261,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 \
+@@ -13625,6 +14296,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -14381,7 +15053,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.
+@@ -14484,19 +15157,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
+
+@@ -14526,6 +15222,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
+
+@@ -14535,6 +15237,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
+
+@@ -14649,12 +15354,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
+
+@@ -14741,9 +15446,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
+
+@@ -14759,6 +15461,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
+
+@@ -14791,210 +15496,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 07e3162..c0c75d4 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 8378857..7584940 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
+@@ -736,6 +739,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_host_shared
+ '
+@@ -1384,6 +1388,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
+@@ -3907,8 +3913,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -3948,7 +3954,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
+@@ -4764,8 +4770,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
+@@ -4814,6 +4820,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 :
+@@ -4830,6 +4910,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'
+@@ -4998,7 +5083,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
+ ;;
+@@ -5152,6 +5238,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
+@@ -5167,9 +5268,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 :
+@@ -5185,7 +5440,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
+@@ -5205,11 +5460,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 :
+@@ -5225,7 +5484,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
+@@ -5244,6 +5503,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
+@@ -5255,16 +5518,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
+
+
+
+@@ -5606,8 +5925,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=
+@@ -5643,6 +5962,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
+@@ -5684,6 +6004,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
+@@ -5695,7 +6027,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;
+ }
+@@ -5721,8 +6053,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
+@@ -5732,8 +6064,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
+@@ -5770,6 +6102,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
++
++
++
++
++
++
++
+
+
+
+@@ -5790,6 +6135,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.
+@@ -6001,6 +6381,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*)
+@@ -6567,6 +7064,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
+@@ -7030,7 +7529,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7119,7 +7619,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,
+@@ -7417,8 +7917,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,'
+@@ -7584,6 +8082,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)
+@@ -7646,7 +8150,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,';;
+@@ -7703,13 +8207,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.
+@@ -7770,6 +8278,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8120,7 +8633,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'
+@@ -8219,12 +8733,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
+@@ -8238,8 +8752,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
+ ;;
+
+@@ -8257,8 +8771,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
+@@ -8304,8 +8818,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
+@@ -8435,7 +8949,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
+@@ -8451,22 +8971,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"
+@@ -8478,7 +9005,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
+@@ -8494,22 +9027,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,
+@@ -8554,20 +9094,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*)
+@@ -8628,7 +9211,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
+@@ -8636,7 +9219,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
+@@ -8652,7 +9235,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
+@@ -8676,10 +9259,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
+@@ -8758,26 +9341,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'
+@@ -8862,7 +9458,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 \*'
+@@ -8881,9 +9477,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"*)
+@@ -9459,8 +10055,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}`~
+@@ -9493,13 +10090,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
+ ;;
+@@ -9591,7 +10246,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
+ ;;
+
+@@ -10405,7 +11060,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10408 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10449,10 +11104,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);
+@@ -10511,7 +11166,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 10514 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10555,10 +11210,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);
+@@ -11990,13 +12645,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"`'
+@@ -12011,14 +12673,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"`'
+@@ -12051,12 +12716,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"`'
+@@ -12111,8 +12776,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 \
+@@ -12122,12 +12792,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 \
+@@ -12143,7 +12815,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 \
+@@ -12179,6 +12850,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -12768,7 +13440,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.
+@@ -12871,19 +13544,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
+
+@@ -12913,6 +13609,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
+
+@@ -12922,6 +13624,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
+
+@@ -13036,12 +13741,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
+
+@@ -13128,9 +13833,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
+
+@@ -13146,6 +13848,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
+
+@@ -13178,210 +13883,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.7.1
+
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
new file mode 100644
index 000000000..cb3f83b4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch
@@ -0,0 +1,35 @@
+From 4ff9dbe13f38e4fea24fbcc9879cf7352c0561ff 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/14] 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 3bd4bc9..5d99921 100644
+--- a/gas/config/tc-arm.c
++++ b/gas/config/tc-arm.c
+@@ -24791,6 +24791,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.7.1
+
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
new file mode 100644
index 000000000..f8382f872
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch
@@ -0,0 +1,35 @@
+From cb36d94dbd521752e6444418af500e139a26eabb 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/14] 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 7d7e2f4..1aaaf0e 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.7.1
+
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
new file mode 100644
index 000000000..d3f510b11
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch
@@ -0,0 +1,273 @@
+From 4daa841ce16ba52b717bdff9eb1dfc4f19638814 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/14] 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 276fb77..35c58eb 100644
+--- a/ld/config.in
++++ b/ld/config.in
+@@ -14,6 +14,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 eb4f0d7..e9054b4 100755
+--- a/ld/configure
++++ b/ld/configure
+@@ -790,6 +790,7 @@ with_lib_path
+ enable_targets
+ enable_64_bit_bfd
+ with_sysroot
++enable_poison_system_directories
+ enable_gold
+ enable_got
+ enable_compressed_debug_sections
+@@ -1446,6 +1447,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)
+@@ -16306,6 +16309,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 e28f38e..7b474e7 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 d84ec4e..3476b26 100644
+--- a/ld/ld.h
++++ b/ld/ld.h
+@@ -164,6 +164,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 2389661..d06112b 100644
+--- a/ld/ld.texinfo
++++ b/ld/ld.texinfo
+@@ -2338,6 +2338,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 96f9ecc..af231c0 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 6f11e7b..0ca3110 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 bb0b9cc..a23c56c 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 e2fb212..a2064f1 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.7.1
+
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
new file mode 100644
index 000000000..407424103
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
@@ -0,0 +1,52 @@
+From bb9eb09411ddcef515f0f7ad7c29214b0766e960 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/14] 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.7.1
+
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
new file mode 100644
index 000000000..c0d2d718a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch
@@ -0,0 +1,59 @@
+From af1b4ee69b4fd617b88127ed40c3ca7351a9532f 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/14] 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 c5688cb..5c27b49 100644
+--- a/bfd/config.bfd
++++ b/bfd/config.bfd
+@@ -1087,12 +1087,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 6b6bbf2..b45b1e5 100644
+--- a/ld/configure.tgt
++++ b/ld/configure.tgt
+@@ -509,11 +509,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.7.1
+
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
new file mode 100644
index 000000000..af7f12ff8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch
@@ -0,0 +1,413 @@
+From 9f967c555b3fda64af4549ae252a0fba00120529 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/14] 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 f78b910..d0d8dd3 100644
+--- a/bfd/aoutx.h
++++ b/bfd/aoutx.h
+@@ -802,6 +802,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 51068b9..727741f 100644
+--- a/bfd/archures.c
++++ b/bfd/archures.c
+@@ -181,6 +181,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 779ffbf..bf5a565 100644
+--- a/bfd/bfd-in2.h
++++ b/bfd/bfd-in2.h
+@@ -1993,6 +1993,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 5c27b49..d553039 100644
+--- a/bfd/config.bfd
++++ b/bfd/config.bfd
+@@ -1066,6 +1066,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*-*-vxworks | mips*-*-windiss)
+ 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 8a9475d..de7e5a3 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 1f2f4a3..700afd3 100644
+--- a/bfd/elfxx-mips.c
++++ b/bfd/elfxx-mips.c
+@@ -6605,6 +6605,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)
+ {
+@@ -11901,6 +11904,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;
+@@ -13931,6 +13938,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 d5dd46f..66810cc 100644
+--- a/binutils/readelf.c
++++ b/binutils/readelf.c
+@@ -3140,6 +3140,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 a2d45a4..75902c0 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
+@@ -18702,7 +18704,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 },
+
+ /* i6400. */
+ { "i6400", 0, ASE_MSA, ISA_MIPS64R6, CPU_MIPS64R6},
+diff --git a/gas/configure b/gas/configure
+index 89f18b3..86b19ae 100755
+--- a/gas/configure
++++ b/gas/configure
+@@ -12851,6 +12851,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 086e0d2..2b71270 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 57de3bc..9ba141d 100644
+--- a/include/elf/mips.h
++++ b/include/elf/mips.h
+@@ -285,6 +285,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 9318fcc..9be5645 100644
+--- a/include/opcode/mips.h
++++ b/include/opcode/mips.h
+@@ -1228,8 +1228,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
+@@ -1326,6 +1328,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. */
+
+@@ -1403,6 +1406,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 b45b1e5..fb2f36a 100644
+--- a/ld/configure.tgt
++++ b/ld/configure.tgt
+@@ -495,6 +495,8 @@ mips*el-sde-elf*) targ_emul=elf32ltsmip
+ 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 8200920..40d9fe2 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 402f887..3764836 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
+
+@@ -957,6 +958,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 },
+@@ -989,12 +991,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 },
+@@ -1066,6 +1069,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 },
+@@ -1081,6 +1085,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 },
+@@ -1234,9 +1240,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 },
+@@ -1401,7 +1407,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 },
+@@ -1446,10 +1452,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 },
+@@ -1499,7 +1508,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 },
+@@ -1936,9 +1945,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.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-Fix-GOT-address-computations-in-initial-PLT-entries-.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-Fix-GOT-address-computations-in-initial-PLT-entries-.patch
new file mode 100644
index 000000000..24af1207c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0013-Fix-GOT-address-computations-in-initial-PLT-entries-.patch
@@ -0,0 +1,72 @@
+From 9619a608528383a44ccc1637ae939b5f3e97adc5 Mon Sep 17 00:00:00 2001
+From: Sandra Loosemore <sandra@codesourcery.com>
+Date: Wed, 9 Dec 2015 16:13:58 -0800
+Subject: [PATCH 13/14] Fix GOT address computations in initial PLT entries for
+ nios2.
+
+2015-12-09 Sandra Loosemore <sandra@codesourcery.com>
+
+ bfd/
+ * elf32-nios2.c (nios2_elf32_finish_dynamic_sections): Correct
+ %hiadj/%lo computations for _GLOBAL_OFFSET_TABLE_ in initial
+ PLT entries. Assert alignment requirements.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Backport
+---
+ bfd/elf32-nios2.c | 23 ++++++++++++++++-------
+ 1 file changed, 16 insertions(+), 7 deletions(-)
+
+diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
+index 6b29d8b..1c54320 100644
+--- a/bfd/elf32-nios2.c
++++ b/bfd/elf32-nios2.c
+@@ -5383,12 +5383,17 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ + sgotplt->output_offset);
+ if (bfd_link_pic (info))
+ {
+- bfd_vma corrected = got_address - (splt->output_section->vma
+- + splt->output_offset + 4);
++ bfd_vma got_pcrel = got_address - (splt->output_section->vma
++ + splt->output_offset);
++ /* Both GOT and PLT must be aligned to a 16-byte boundary
++ for the two loads to share the %hiadj part. The 4-byte
++ offset for nextpc is accounted for in the %lo offsets
++ on the loads. */
++ BFD_ASSERT ((got_pcrel & 0xf) == 0);
+ nios2_elf32_install_data (splt, nios2_so_plt0_entry, 0, 6);
+- nios2_elf32_install_imm16 (splt, 4, hiadj (corrected));
+- nios2_elf32_install_imm16 (splt, 12, (corrected & 0xffff) + 4);
+- nios2_elf32_install_imm16 (splt, 16, (corrected & 0xffff) + 8);
++ nios2_elf32_install_imm16 (splt, 4, hiadj (got_pcrel));
++ nios2_elf32_install_imm16 (splt, 12, got_pcrel & 0xffff);
++ nios2_elf32_install_imm16 (splt, 16, (got_pcrel + 4) & 0xffff);
+ }
+ else
+ {
+@@ -5404,6 +5409,10 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 6 | ((res_size - (res_offset + 4)) << 6),
+ splt->contents + res_offset);
+
++ /* The GOT must be aligned to a 16-byte boundary for the
++ two loads to share the same %hiadj part. */
++ BFD_ASSERT ((got_address & 0xf) == 0);
++
+ nios2_elf32_install_data (splt, nios2_plt0_entry, res_size, 7);
+ nios2_elf32_install_imm16 (splt, res_size, hiadj (res_start));
+ nios2_elf32_install_imm16 (splt, res_size + 4,
+@@ -5411,9 +5420,9 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ nios2_elf32_install_imm16 (splt, res_size + 12,
+ hiadj (got_address));
+ nios2_elf32_install_imm16 (splt, res_size + 16,
+- (got_address & 0xffff) + 4);
++ (got_address + 4) & 0xffff);
+ nios2_elf32_install_imm16 (splt, res_size + 20,
+- (got_address & 0xffff) + 8);
++ (got_address + 8) & 0xffff);
+ }
+ }
+ }
+--
+2.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-Correct-nios2-_gp-address-computation.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-Correct-nios2-_gp-address-computation.patch
new file mode 100644
index 000000000..86eeded6e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0014-Correct-nios2-_gp-address-computation.patch
@@ -0,0 +1,106 @@
+From 27f155fd0ab4ba954366643dbfdc3c7104933794 Mon Sep 17 00:00:00 2001
+From: Sandra Loosemore <sandra@codesourcery.com>
+Date: Sun, 27 Dec 2015 12:30:26 -0800
+Subject: [PATCH 14/14] Correct nios2 _gp address computation.
+
+2015-12-27 Sandra Loosemore <sandra@codesourcery.com>
+
+ bfd/
+ * elf32-nios2.c (nios2_elf_assign_gp): Correct computation of _gp
+ address.
+ (nios2_elf32_relocate_section): Tidy code for R_NIOS2_GPREL error
+ messages.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Backport
+---
+ bfd/elf32-nios2.c | 31 +++++++++++++++++++++----------
+ 1 file changed, 21 insertions(+), 10 deletions(-)
+
+diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
+index 1c54320..babecf3 100644
+--- a/bfd/elf32-nios2.c
++++ b/bfd/elf32-nios2.c
+@@ -3086,7 +3086,15 @@ lookup:
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ gp_found = TRUE;
+- *pgp = lh->u.def.value;
++ {
++ asection *sym_sec = lh->u.def.section;
++ bfd_vma sym_value = lh->u.def.value;
++
++ if (sym_sec->output_section)
++ sym_value = (sym_value + sym_sec->output_offset
++ + sym_sec->output_section->vma);
++ *pgp = sym_value;
++ }
+ break;
+ case bfd_link_hash_indirect:
+ case bfd_link_hash_warning:
+@@ -3719,7 +3727,6 @@ nios2_elf32_relocate_section (bfd *output_bfd,
+ struct elf32_nios2_link_hash_entry *eh;
+ bfd_vma relocation;
+ bfd_vma gp;
+- bfd_vma reloc_address;
+ bfd_reloc_status_type r = bfd_reloc_ok;
+ const char *name = NULL;
+ int r_type;
+@@ -3762,12 +3769,6 @@ nios2_elf32_relocate_section (bfd *output_bfd,
+ if (bfd_link_relocatable (info))
+ continue;
+
+- if (sec && sec->output_section)
+- reloc_address = (sec->output_section->vma + sec->output_offset
+- + rel->r_offset);
+- else
+- reloc_address = 0;
+-
+ if (howto)
+ {
+ switch (howto->type)
+@@ -3816,6 +3817,15 @@ nios2_elf32_relocate_section (bfd *output_bfd,
+ /* Turns an absolute address into a gp-relative address. */
+ if (!nios2_elf_assign_gp (output_bfd, &gp, info))
+ {
++ bfd_vma reloc_address;
++
++ if (sec && sec->output_section)
++ reloc_address = (sec->output_section->vma
++ + sec->output_offset
++ + rel->r_offset);
++ else
++ reloc_address = 0;
++
+ format = _("global pointer relative relocation at address "
+ "0x%08x when _gp not defined\n");
+ sprintf (msgbuf, format, reloc_address);
+@@ -3825,7 +3835,7 @@ nios2_elf32_relocate_section (bfd *output_bfd,
+ else
+ {
+ bfd_vma symbol_address = rel->r_addend + relocation;
+- relocation = relocation + rel->r_addend - gp;
++ relocation = symbol_address - gp;
+ rel->r_addend = 0;
+ if (((signed) relocation < -32768
+ || (signed) relocation > 32767)
+@@ -3833,6 +3843,8 @@ nios2_elf32_relocate_section (bfd *output_bfd,
+ || h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak))
+ {
++ if (h)
++ name = h->root.root.string;
+ format = _("Unable to reach %s (at 0x%08x) from the "
+ "global pointer (at 0x%08x) because the "
+ "offset (%d) is out of the allowed range, "
+@@ -3848,7 +3860,6 @@ nios2_elf32_relocate_section (bfd *output_bfd,
+ rel->r_offset, relocation,
+ rel->r_addend);
+ }
+-
+ break;
+ case R_NIOS2_UJMP:
+ r = nios2_elf32_do_ujmp_relocate (input_bfd, howto,
+--
+2.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils_2.26.bb b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils_2.26.bb
new file mode 100644
index 000000000..b70ffbf28
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils_2.26.bb
@@ -0,0 +1,40 @@
+require binutils.inc
+require binutils-${PV}.inc
+
+DEPENDS += "flex bison zlib"
+
+EXTRA_OECONF += "--with-sysroot=/ \
+ --enable-install-libbfd \
+ --enable-install-libiberty \
+ --enable-shared \
+ --with-system-zlib \
+ "
+
+EXTRA_OECONF_class-native = "--enable-targets=all \
+ --enable-64-bit-bfd \
+ --enable-install-libiberty \
+ --enable-install-libbfd"
+
+do_install_class-native () {
+ autotools_do_install
+
+ # Install the libiberty header
+ install -d ${D}${includedir}
+ install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
+ install -m 644 ${S}/include/libiberty.h ${D}${includedir}
+
+ # We only want libiberty, libbfd and libopcodes
+ rm -rf ${D}${bindir}
+ rm -rf ${D}${prefix}/${TARGET_SYS}
+ rm -rf ${D}${prefix}/lib/ldscripts
+ rm -rf ${D}${prefix}/share/info
+ rm -rf ${D}${prefix}/share/locale
+ rm -rf ${D}${prefix}/share/man
+ rmdir ${D}${prefix}/share || :
+ rmdir ${D}/${libdir}/gcc-lib || :
+ rmdir ${D}/${libdir}64/gcc-lib || :
+ rmdir ${D}/${libdir} || :
+ rmdir ${D}/${libdir}64 || :
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch
new file mode 100644
index 000000000..9543a56f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch
@@ -0,0 +1,33 @@
+From 3a15f7c9ace6c0294edc313a1848cafcc31b2a92 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 24 Apr 2015 00:38:32 -0700
+Subject: [PATCH] src/local.mk: fix parallel issue
+
+Fixed:
+rm -f src/yacc src/yacc.tmp
+echo '#! /bin/sh' >src/yacc.tmp
+/bin/bash: src/yacc.tmp: No such file or directory
+Makefile:6670: recipe for target 'src/yacc' failed
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ src/local.mk | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/local.mk b/src/local.mk
+index 573ad00..28bfae4 100644
+--- a/src/local.mk
++++ b/src/local.mk
+@@ -119,6 +119,7 @@ MOSTLYCLEANFILES += src/yacc
+
+ src/yacc:
+ $(AM_V_GEN)rm -f $@ $@.tmp
++ $(AM_V_at)$(MKDIR_P) src
+ $(AM_V_at)echo '#! /bin/sh' >$@.tmp
+ $(AM_V_at)echo "exec '$(bindir)/bison' -y "'"$$@"' >>$@.tmp
+ $(AM_V_at)chmod a+x $@.tmp
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch
new file mode 100644
index 000000000..35c0f6fa3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch
@@ -0,0 +1,58 @@
+From 41fdca818cdc7bd686c31aff4088b89280d71a42 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 17 Feb 2016 22:01:28 -0500
+Subject: [PATCH] m4/bison-i18n.m4: add --with-bisonlocaledir to assign
+ BISON_LOCALEDIR
+
+The variable BISON_LOCALEDIR is assigned only by the output of
+'bison --print-localedir', we add option --with-bisonlocaledir
+to assign it explicitly. It is helpful for user to split the
+native compile and cross compile.
+
+For backward compatibility, if option not used, it still
+make use of the output of 'bison --print-localedir'.
+
+Upstream-Status: Submitted [bison-patches@gnu.org]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ m4/bison-i18n.m4 | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/m4/bison-i18n.m4 b/m4/bison-i18n.m4
+index 8e57caf..c36f498 100644
+--- a/m4/bison-i18n.m4
++++ b/m4/bison-i18n.m4
+@@ -16,11 +16,16 @@ dnl sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files
+ dnl and defines YYENABLE_NLS if there are bison-runtime.mo files at all.
+ AC_DEFUN([BISON_I18N],
+ [
++ dnl Default is not to set bisonlocaledir
++ AC_ARG_WITH([bisonlocaledir],
++ [ --with-bisonlocaledir sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files],
++ BISON_LOCALEDIR=$withval,
++ BISON_LOCALEDIR=)
++
+ if test -z "$USE_NLS"; then
+ echo "The BISON-I18N macro is used without being preceded by AM-GNU-GETTEXT." 1>&2
+ exit 1
+ fi
+- BISON_LOCALEDIR=
+ BISON_USE_NLS=no
+ if test "$USE_NLS" = yes; then
+ dnl Determine bison's localedir.
+@@ -28,9 +33,10 @@ AC_DEFUN([BISON_I18N],
+ dnl But even is YACC is called "yacc", it may be a script that invokes bison
+ dnl and accepts the --print-localedir option.
+ dnl YACC's default value is empty; BISON's default value is :.
+- if (${YACC-${BISON-:}} --print-localedir) >/dev/null 2>&1; then
++ if test -z "$BISON_LOCALEDIR" -a ${YACC-${BISON-:}} --print-localedir >/dev/null 2>&1; then
+ BISON_LOCALEDIR=`${YACC-${BISON-:}} --print-localedir`
+ fi
++ AC_MSG_RESULT([$BISON_LOCALEDIR])
+ AC_SUBST([BISON_LOCALEDIR])
+ if test -n "$BISON_LOCALEDIR"; then
+ dnl There is no need to enable internationalization if the user doesn't
+--
+1.9.1
+
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
new file mode 100644
index 000000000..348ce1d2b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/bison-2.3_m4.patch
@@ -0,0 +1,591 @@
+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/dont-depend-on-help2man.patch.patch b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/dont-depend-on-help2man.patch.patch
new file mode 100644
index 000000000..ac16c5770
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/dont-depend-on-help2man.patch.patch
@@ -0,0 +1,46 @@
+From 4c0d7733f30903f8d7c7cd7433f5c8a7505e35f5 Mon Sep 17 00:00:00 2001
+From: Marko Lindqvist <cazfi74@gmail.com>
+Date: Tue, 21 Apr 2015 00:48:45 -0700
+Subject: [PATCH] doc/local.mk: dont-depend-on-help2man.patch
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+Updated for bison 3.0.4
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ doc/local.mk | 9 +--------
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/doc/local.mk b/doc/local.mk
+index c340452..642f385 100644
+--- a/doc/local.mk
++++ b/doc/local.mk
+@@ -98,10 +98,7 @@ endif ! CROSS_COMPILING
+ ## Man Pages. ##
+ ## ----------- ##
+
+-dist_man_MANS = $(top_srcdir)/doc/bison.1
+-
+-EXTRA_DIST += $(dist_man_MANS:.1=.x)
+-MAINTAINERCLEANFILES += $(dist_man_MANS)
++EXTRA_DIST += bison.x
+
+ # Differences to ignore when comparing the man page (the date).
+ remove_time_stamp = \
+@@ -124,10 +121,6 @@ $(top_srcdir)/doc/bison.1: $(MAN_DEPS)
+ fi
+ $(AM_V_at)rm -f $@*.t
+
+-if ENABLE_YACC
+-nodist_man_MANS = doc/yacc.1
+-endif
+-
+ ## ----------------------------- ##
+ ## Graphviz examples generation. ##
+ ## ----------------------------- ##
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/m4.patch b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/m4.patch
new file mode 100644
index 000000000..d139da5e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison/m4.patch
@@ -0,0 +1,414 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+Index: bison-2.4.2/m4/lcmessage.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/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
++])
+Index: bison-2.4.2/m4/uintmax_t.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/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
++])
+Index: bison-2.4.2/m4/ulonglong.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/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
++])
+Index: bison-2.4.2/m4/intdiv0.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/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.])
++])
+Index: bison-2.4.2/m4/glib.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/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
++])
+Index: bison-2.4.2/m4/isc-posix.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/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
new file mode 100644
index 000000000..182e8802b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison_2.3.bb
@@ -0,0 +1,26 @@
+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/bison/bison_3.0.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison_3.0.4.bb
new file mode 100644
index 000000000..cffcd885a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bison/bison_3.0.4.bb
@@ -0,0 +1,40 @@
+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 = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+SECTION = "devel"
+DEPENDS = "bison-native flex-native"
+
+SRC_URI = "${GNU_MIRROR}/bison/bison-${PV}.tar.xz \
+ file://m4.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://dont-depend-on-help2man.patch.patch \
+ file://0001-src-local.mk-fix-parallel-issue.patch \
+ file://add-with-bisonlocaledir.patch \
+"
+
+# No point in hardcoding path to m4, just use PATH
+EXTRA_OECONF += "M4=m4"
+
+SRC_URI[md5sum] = "c342201de104cc9ce0a21e0ad10d4021"
+SRC_URI[sha256sum] = "a72428c7917bdf9fa93cb8181c971b6e22834125848cf1d03ce10b1bb0716fe1"
+
+LDFLAGS_prepend_libc-uclibc = " -lrt "
+DEPENDS_class-native = "gettext-minimal-native"
+
+inherit autotools gettext texinfo
+acpaths = "-I ${S}/m4"
+
+do_compile_prepend() {
+ for i in mfcalc calc++ rpcalc; do mkdir -p ${B}/examples/$i; done
+}
+
+do_install_append_class-native() {
+ create_wrapper ${D}/${bindir}/bison \
+ BISON_PKGDATADIR=${STAGING_DATADIR_NATIVE}/bison
+}
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh b/import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh
new file mode 100644
index 000000000..21a78877a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: bootchartd_stop
+# Required-Start: $remote_fs $all
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop:
+# Short-Description: Stop bootchartd collection
+# Description: This script accompanies bootchartd from bootchart2.
+# bootchartd should stop detect the end of the boot process
+# automatically if a window manager is launched, but for
+# command-line only operating systems, this script should be
+# used instead.
+### END INIT INFO
+
+/sbin/bootchartd stop
+
+: exit 0
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb b/import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb
new file mode 100644
index 000000000..86c614a63
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb
@@ -0,0 +1,155 @@
+# Copyright (c) 2013 LG Electronics, Inc.
+# Copyright (C) 2014 Intel Corp.
+
+# This recipe creates packages for the bootchart2 system-wide profiler daemon
+# and related utilities. Depending on the images you're building, additional
+# configuration may be needed in order to use it.
+#
+# Packages:
+# * bootchart2 - The daemon itself.
+# * pybootchartgui - Python program to visualize and display the data
+# collected by bootchart2 or compatible daemons such as the original
+# bootchart.
+# * bootchartd-stop-initscript - A SysV init script to stop data collection
+# when booting completes (see below for details.)
+#
+# While bootchart2 is designed to stop collecting data roughly when the boot
+# process completes, it is not exactly a stopwatch. It has a list of programs
+# which are supposed signify that the boot process has completed (for example,
+# openbox or gnome-shell,) but it waits a full 20 seconds after such a program
+# is launched before stopping itself, to collect additional data.
+#
+# If you are using a window manager or GUI which isn't included in bootchart2's
+# default configuration file, you should write bbappend file to amend
+# bootchartd.conf and add it to EXIT_PROC. An example of this is shown in this
+# recipe, where the Matchbox window manager (used by Sato) is added.
+#
+# If you want data collection to end at a certain point exactly, you should
+# arrange for the following command to be run:
+# bootchartd stop
+# You might set this command to be launched by the desktop environment shipped
+# on the image you're building after the other startup programs are complete.
+# This will not incur the 20 second wait period and will cause bootchart2 to
+# behave a bit more like a stopwatch. An example of this is shown in this
+# recipe, specifically the bootchartd-stop-initscript package, which stops data
+# collection as the last action when switching to runlevels 2 through 5. You can
+# add bootchartd-stop-initscript to IMAGE_INSTALL if you need to use it.
+#
+# Unless you're doing something special, if your image does not launch an X
+# window manager, you will need to add bootchartd-stop-initscript to your image.
+#
+# Bootchart2 can be started in two ways. Data collection can be initiated by
+# running the following command:
+# bootchartd start
+# However, for the most complete data, the bootchart2 developers recommend
+# running it as PID 1. This can be done by adding the following to the kernel
+# command line parameters in the bootloader setup:
+# init=/sbin/bootchartd
+# When invoked this way, bootchart2 will set itself up and then automatically
+# run /sbin/init. For example, when booting the default qemux86 image, one might
+# use a command like this:
+# runqemu qemux86 bootparams="initcall_debug printk.time=y quiet \
+# init=/sbin/bootchartd"
+#
+# Neither method is actually implemented here, choose what works for you.
+#
+# If you are building your image with systemd instead of SysV init, bootchart2
+# includes systemd service files to begin collection automatically at boot and
+# end collection automatically 20 seconds after the boot process has completed.
+# However, be aware that systemd tends to start bootchart2 relatively late into
+# the boot process, so it's highly recommended to use bootchart2 as PID 1. If
+# you're using systemd and you wish to use another method to stop data
+# collection at a time of your choosing, you may do so as long as you get to it
+# before the 20 second timeout of the systemd service files. Also, you may write
+# a bbappend to patch bootchart2-done.timer.in to increase or decrease the
+# timeout. Decreasing it to 0 will make it behave like
+# bootchartd-stop-initscript.
+#
+# By default, when data collection is stopped, a file named bootchart.tgz will
+# be created in /var/log. If pybootchartgui is included in your image,
+# bootchart.png will also be created at the same time. However, this results in
+# a noticeable hitch or pause at boot time, which may not be what you want on an
+# embedded device. So you may prefer to omit pybootchartgui from your image. In
+# that case, copy bootchart.tgz over to your development system and generate
+# bootchart.png there. To get pybootchartgui on your development system, you can
+# either install it directly from some other source, or build bootchart2-native
+# and find pybootchartgui in the native sysroot:
+# bitbake bootchart2-native
+# ./tmp/sysroots/x86_64-linux/usr/bin/pybootchartgui /path/to/bootchart.tgz
+# Note that, whether installed on your build system or on your image, the
+# pybootchartgui provided by this recipe does not support the -i option. You
+# will need to install pybootchartgui by other means in order to run it in
+# interactive mode.
+
+SUMMARY = "Booting sequence and CPU,I/O usage monitor"
+DESCRIPTION = "Monitors where the system spends its time at start, creating a graph of all processes, disk utilization, and wait time."
+AUTHOR = "Wonhong Kwon <wonhong.kwon@lge.com>"
+HOMEPAGE = "https://github.com/mmeeks/bootchart"
+LICENSE = "GPL-3.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=44ac4678311254db62edf8fd39cb8124"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)"
+
+SRC_URI = "git://github.com/mmeeks/bootchart.git \
+ file://bootchartd_stop.sh \
+ "
+
+S = "${WORKDIR}/git"
+SRCREV = "48e0071048564c6af75ab969e842d6dec808da09"
+
+inherit systemd
+inherit update-rc.d
+inherit pythonnative
+
+# The only reason to build bootchart2-native is for a native pybootchartgui.
+BBCLASSEXTEND = "native"
+
+SYSTEMD_SERVICE_${PN} = "bootchart2.service bootchart2-done.service bootchart2-done.timer"
+
+UPDATERCPN = "bootchartd-stop-initscript"
+INITSCRIPT_NAME = "bootchartd_stop.sh"
+INITSCRIPT_PARAMS = "start 99 2 3 4 5 ."
+
+# We want native pybootchartgui to execute with the correct Python interpeter.
+do_compile_append_class-native () {
+ echo "#! ${PYTHON}" | cat - ${S}/pybootchartgui.py > ${WORKDIR}/temp_pybootchartgui
+ mv ${WORKDIR}/temp_pybootchartgui ${S}/pybootchartgui.py
+ chmod +x ${S}/pybootchartgui
+}
+
+do_compile_prepend () {
+ export PY_LIBDIR="${libdir}/${PYTHON_DIR}"
+ export BINDIR="${bindir}"
+ export LIBDIR="${base_libdir}"
+}
+
+do_install () {
+ install -d ${D}${sysconfdir} # needed for -native
+ export PY_LIBDIR="${libdir}/${PYTHON_DIR}"
+ export BINDIR="${bindir}"
+ export DESTDIR="${D}"
+ export LIBDIR="${base_libdir}"
+
+ oe_runmake install
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/bootchartd_stop.sh ${D}${sysconfdir}/init.d
+
+ echo 'EXIT_PROC="$EXIT_PROC matchbox-window-manager"' >> ${D}${sysconfdir}/bootchartd.conf
+}
+
+PACKAGES =+ "pybootchartgui"
+FILES_pybootchartgui += "${libdir}/python*/site-packages/pybootchartgui ${bindir}/pybootchartgui"
+RDEPENDS_pybootchartgui = "python-pycairo python-compression python-image python-textutils python-shell python-compression python-codecs"
+RDEPENDS_${PN}_class-target += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit-pidof', 'procps', d)}"
+RDEPENDS_${PN}_class-target += "lsb"
+DEPENDS_append_class-native = " python-pycairo-native"
+
+PACKAGES =+ "bootchartd-stop-initscript"
+FILES_bootchartd-stop-initscript += "${sysconfdir}/init.d ${sysconfdir}/rc*.d"
+
+FILES_${PN} += "${base_libdir}/bootchart/bootchart-collector"
+FILES_${PN} += "${base_libdir}/bootchart/tmpfs"
+FILES_${PN} += "${libdir}"
+FILES_${PN}-doc += "${datadir}/docs"
+
+RCONFLICTS_${PN} = "bootchart"
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
new file mode 100644
index 000000000..bbc53c6fe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-parallel.patch
@@ -0,0 +1,32 @@
+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/fix-symlink-creation-multiple-times.patch b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-symlink-creation-multiple-times.patch
new file mode 100644
index 000000000..a94549639
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-symlink-creation-multiple-times.patch
@@ -0,0 +1,46 @@
+From 05ab78e9183575e38f342e05a056cb7bcd1e52e1 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 18 Feb 2016 20:41:28 -0500
+Subject: [PATCH] btrfs-progs: fix symlink creation multiple times
+
+The rule to create symlink in Makefile caused parallel issue:
+$ make -j 40 DESTDIR=/image install BUILD_VERBOSE=1
+...
+ 1 [LN] libbtrfs.so.0
+ 2 [LN] libbtrfs.so
+ 3 ln -s -f libbtrfs.so.0.1 libbtrfs.so.0
+ 4 ln -s -f libbtrfs.so.0.1 libbtrfs.so.0
+ 5 ln -s -f libbtrfs.so.0.1 libbtrfs.so
+ 6 ln -s -f libbtrfs.so.0.1 libbtrfs.so
+...
+
+It failed occasionally:
+...
+|symlinkat: couldn't stat 'git/libbtrfs.so' even though symlink
+creation succeeded (No such file or directory).
+|ln: failed to create symbolic link 'libbtrfs.so': No such file or directory
+...
+
+Upstream-Status: Submitted [linux-btrfs@vger.kernel.org]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 1f4002e..16eeaf9 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -236,8 +236,7 @@ $(libs_static): $(libbtrfs_objects)
+
+ $(lib_links):
+ @echo " [LN] $@"
+- $(Q)$(LN_S) -f libbtrfs.so.0.1 libbtrfs.so.0
+- $(Q)$(LN_S) -f libbtrfs.so.0.1 libbtrfs.so
++ $(Q)$(LN_S) -f libbtrfs.so.0.1 $@
+
+ # keep intermediate files from the below implicit rules around
+ .PRECIOUS: $(addsuffix .o,$(progs))
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.4.bb
new file mode 100644
index 000000000..32e7bae58
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.4.bb
@@ -0,0 +1,34 @@
+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 = "21258fab2caeade405a15ba932d373b364aa6e8c"
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \
+ file://fix-parallel.patch \
+ file://fix-symlink-creation-multiple-times.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/build-compare/build-compare_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/build-compare_git.bb
new file mode 100644
index 000000000..676f11dd8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/build-compare_git.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Build Result Compare Script"
+DESCRIPTION = "This package contains scripts to find out if the build result\
+differs to a former build."
+HOMEPAGE = "https://github.com/openSUSE/build-compare"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "git://github.com/openSUSE/build-compare.git \
+ file://Rename-rpm-check.sh-to-pkg-diff.sh.patch;striplevel=1 \
+ file://Ignore-DWARF-sections.patch;striplevel=1 \
+ file://0001-Add-support-for-deb-and-ipk-packaging.patch \
+ "
+
+SRCREV = "c5352c054c6ef15735da31b76d6d88620f4aff0a"
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND += "native nativesdk"
+
+do_install() {
+ install -d ${D}/${bindir}
+ install -m 755 functions.sh ${D}/${bindir}
+ install -m 755 pkg-diff.sh ${D}/${bindir}
+ install -m 755 same-build-result.sh ${D}/${bindir}
+ install -m 755 srpm-check.sh ${D}/${bindir}
+}
+
+RDEPENDS_${PN} += "bash"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch
new file mode 100644
index 000000000..5c15218c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch
@@ -0,0 +1,64 @@
+From 02dbc7e3478e409d6f5e3e1c53daddf8838be999 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Tue, 1 Sep 2015 12:04:33 +0100
+Subject: [PATCH] Add support for deb and ipk packaging
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ functions.sh | 15 +++++++++++++++
+ pkg-diff.sh | 6 ++++++
+ 2 files changed, 21 insertions(+)
+
+diff --git a/functions.sh b/functions.sh
+index 06079df..85c9003 100644
+--- a/functions.sh
++++ b/functions.sh
+@@ -85,6 +85,13 @@ function unpackage()
+ CPIO_OPTS="--extract --unconditional --preserve-modification-time --make-directories --quiet"
+ rpm2cpio $file | cpio ${CPIO_OPTS}
+ ;;
++ *.ipk|*.deb)
++ ar x $file
++ tar xf control.tar.gz
++ rm control.tar.gz
++ tar xf data.tar.gz
++ rm data.tar.gz
++ ;;
+ esac
+ popd 1>/dev/null
+ }
+@@ -255,4 +262,12 @@ function cmp_spec ()
+ rm $file1 $file2
+ return $RES
+ }
++
++function adjust_controlfile () {
++ cat $1/control | sed '/^Version: /d' > $1/control.fixed
++ mv $1/control.fixed $1/control
++ cat $2/control | sed '/^Version: /d' > $2/control.fixed
++ mv $2/control.fixed $2/control
++}
++
+ # vim: tw=666 ts=2 et
+diff --git a/pkg-diff.sh b/pkg-diff.sh
+index 0f1fa76..3cf10aa 100644
+--- a/pkg-diff.sh
++++ b/pkg-diff.sh
+@@ -138,6 +138,12 @@ echo "Extracting packages"
+ unpackage $oldpkg $dir/old
+ unpackage $newpkg $dir/new
+
++case $oldpkg in
++ *.deb|*.ipk)
++ adjust_controlfile $dir/old $dir/new
++ ;;
++esac
++
+ # files is set in cmp_spec for rpms, so if RES is empty we should assume
+ # it wasn't an rpm and pick all files for comparison.
+ if [ -z $RES ]; then
+--
+2.1.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch
new file mode 100644
index 000000000..7dda1acbf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch
@@ -0,0 +1,40 @@
+From 015715694eadd714b903f30ade876e0738d44974 Mon Sep 17 00:00:00 2001
+From: Randy Witt <randy.e.witt@linux.intel.com>
+Date: Mon, 5 Jan 2015 15:09:20 -0800
+Subject: [PATCH] Ignore DWARF sections.
+
+Assume for now that we don't care about the DWARF sections due to path
+differences. However, in the case the tool is ran on a "debug" package
+it will most likely falsely say the packages have no differences.
+
+Upstream-Status: Inappropriate [other]
+
+The package difference tool is correctly labelling the packages as different
+when the DWARF sections don't match due to paths. The paths in the debug info
+should actually be made to be the same using compile flags or some other
+mechanism.
+
+However, to make the tool more useful to Yocto until the work can be done
+to ensure identical paths in debug sections, this patch is being applied.
+
+Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
+---
+ pkg-diff.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pkg-diff.sh b/pkg-diff.sh
+index 56035c1..0f1fa76 100755
+--- a/pkg-diff.sh
++++ b/pkg-diff.sh
+@@ -658,7 +658,7 @@ check_single_file()
+ echo "" >$file1
+ echo "" >$file2
+ # Don't compare .build-id and .gnu_debuglink sections
+- sections="$(objdump -s new/$file | grep "Contents of section .*:" | sed -r "s,.* (.*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" | tr "\n" " ")"
++ sections="$(objdump -s new/$file | grep "Contents of section .*:" | sed -r "s,.* (.*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" -e "\.debug_abbrev" -e "\.debug_aranges" -e "\.debug_frame" -e "\.debug_info" -e "\.debug_line" -e "\.debug_loc" -e "\.debug_macinfo" -e "\.debug_pubnames" -e "\.debug_pubtypes" -e "\.debug_ranges" -e "\.debug_str" | tr "\n" " ")"
+ for section in $sections; do
+ objdump -s -j $section old/$file | sed "s,^old/,," > $file1
+ objdump -s -j $section new/$file | sed "s,^new/,," > $file2
+--
+1.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/Rename-rpm-check.sh-to-pkg-diff.sh.patch b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/Rename-rpm-check.sh-to-pkg-diff.sh.patch
new file mode 100644
index 000000000..cff3a9e23
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/build-compare/files/Rename-rpm-check.sh-to-pkg-diff.sh.patch
@@ -0,0 +1,1599 @@
+From 4de3df5a1b361cd09a081f0e0bdb94cbf684ed48 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 19 Feb 2015 00:34:47 -0800
+Subject: [PATCH] Rename rpm-check.sh to pkg-diff.sh.
+
+The tool now accepts package input other than rpm, so change the name
+which could be misleading.
+
+Upstream-Status: Submitted [https://github.com/openSUSE/build-compare/pulls]
+
+Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
+
+Updated for rpm-check.sh.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ build-compare.spec | 2 +-
+ pkg-diff.sh | 765 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ rpm-check.sh | 764 -------------------------------------------------
+ same-build-result.sh | 4 +-
+ 4 files changed, 768 insertions(+), 767 deletions(-)
+ create mode 100644 pkg-diff.sh
+ delete mode 100755 rpm-check.sh
+
+diff --git a/build-compare.spec b/build-compare.spec
+index 14a97e9..5f47ca1 100644
+--- a/build-compare.spec
++++ b/build-compare.spec
+@@ -25,7 +25,7 @@ Version: 2015.02.10
+ Release: 0
+ Source1: COPYING
+ Source2: same-build-result.sh
+-Source3: rpm-check.sh
++Source3: pkg-diff.sh
+ Source4: functions.sh
+ Source5: srpm-check.sh
+ BuildRoot: %{_tmppath}/%{name}-%{version}-build
+diff --git a/pkg-diff.sh b/pkg-diff.sh
+new file mode 100644
+index 0000000..56035c1
+--- /dev/null
++++ b/pkg-diff.sh
+@@ -0,0 +1,765 @@
++#! /bin/bash
++#
++# Copyright (c) 2009, 2010, 2011, 2012 SUSE Linux Product GmbH, Germany.
++# Licensed under GPL v2, see COPYING file for details.
++#
++# Written by Michael Matz and Stephan Coolo
++# Enhanced by Andreas Jaeger
++
++FUNCTIONS=${0%/*}/functions.sh
++
++check_all=
++case $1 in
++ -a | --check-all)
++ check_all=1
++ shift
++esac
++
++if test "$#" != 2; then
++ echo "usage: $0 [-a|--check-all] old.rpm new.rpm"
++ exit 1
++fi
++
++self_script=$(cd $(dirname $0); echo $(pwd)/$(basename $0))
++
++source $FUNCTIONS
++
++oldpkg=`readlink -f $1`
++newpkg=`readlink -f $2`
++rename_script=`mktemp`
++
++if test ! -f "$oldpkg"; then
++ echo "can't open $1"
++ exit 1
++fi
++
++if test ! -f "$newpkg"; then
++ echo "can't open $2"
++ exit 1
++fi
++
++#usage unjar <file>
++function unjar()
++{
++ local file
++ file=$1
++
++ if [[ $(type -p fastjar) ]]; then
++ UNJAR=fastjar
++ elif [[ $(type -p jar) ]]; then
++ UNJAR=jar
++ elif [[ $(type -p unzip) ]]; then
++ UNJAR=unzip
++ else
++ echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
++ exit 1
++ fi
++
++ case $UNJAR in
++ jar|fastjar)
++ # echo jar -xf $file
++ ${UNJAR} -xf $file
++ ;;
++ unzip)
++ unzip -oqq $file
++ ;;
++ esac
++}
++
++# list files in directory
++#usage unjar_l <file>
++function unjar_l()
++{
++ local file
++ file=$1
++
++ if [[ $(type -p fastjar) ]]; then
++ UNJAR=fastjar
++ elif [[ $(type -p jar) ]]; then
++ UNJAR=jar
++ elif [[ $(type -p unzip) ]]; then
++ UNJAR=unzip
++ else
++ echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
++ exit 1
++ fi
++
++ case $UNJAR in
++ jar|fastjar)
++ ${UNJAR} -tf $file
++ ;;
++ unzip)
++ unzip -l $file
++ ;;
++ esac
++}
++
++filter_disasm()
++{
++ sed -e 's/^ *[0-9a-f]\+://' -e 's/\$0x[0-9a-f]\+/$something/' -e 's/callq *[0-9a-f]\+/callq /' -e 's/# *[0-9a-f]\+/# /' -e 's/\(0x\)\?[0-9a-f]\+(/offset(/' -e 's/[0-9a-f]\+ </</' -e 's/^<\(.*\)>:/\1:/' -e 's/<\(.*\)+0x[0-9a-f]\+>/<\1 + ofs>/'
++}
++
++echo "Comparing `basename $oldpkg` to `basename $newpkg`"
++
++case $oldpkg in
++ *.rpm)
++ cmp_spec $rename_script $oldpkg $newpkg
++ RES=$?
++ case $RES in
++ 0)
++ echo "RPM meta information is identical"
++ if test -z "$check_all"; then
++ exit 0
++ fi
++ ;;
++ 1)
++ echo "RPM meta information is different"
++ if test -z "$check_all"; then
++ exit 1
++ fi
++ ;;
++ 2)
++ echo "RPM file checksum differs."
++ RES=0
++ ;;
++ *)
++ echo "Wrong exit code!"
++ exit 1
++ ;;
++ esac
++ ;;
++esac
++
++file1=`mktemp`
++file2=`mktemp`
++
++dir=`mktemp -d`
++echo "Extracting packages"
++unpackage $oldpkg $dir/old
++unpackage $newpkg $dir/new
++
++# files is set in cmp_spec for rpms, so if RES is empty we should assume
++# it wasn't an rpm and pick all files for comparison.
++if [ -z $RES ]; then
++ oldfiles=`cd $dir/old; find . -type f`
++ newfiles=`cd $dir/new; find . -type f`
++
++ files=`echo -e "$oldfiles\n$newfiles" | sort -u`
++fi
++
++cd $dir
++bash $rename_script
++
++dfile=`mktemp`
++
++diff_two_files()
++{
++ if ! cmp -s old/$file new/$file; then
++ echo "$file differs ($ftype)"
++ hexdump -C old/$file > $file1
++ hexdump -C new/$file > $file2
++ diff -u $file1 $file2 | head -n 200
++ return 1
++ fi
++ return 0
++}
++
++trim_man_first_line()
++{
++ # Handles the first line if it is like:
++ #.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
++ #.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.43.3.
++ local f=$1
++ sed -i -e '1{
++ s|^\.\\"[[:blank:]]\+Automatically[[:blank:]]generated[[:blank:]]by[[:blank:]]Pod::Man[[:blank:]].*|.\\" Overly verbose Pod::Man|
++ s|^\.\\"[[:blank:]]\+DO[[:blank:]]NOT[[:blank:]]MODIFY[[:blank:]]THIS[[:blank:]]FILE![[:blank:]]\+It[[:blank:]]was[[:blank:]]generated[[:blank:]]by[[:blank:]]help2man[[:blank:]].*|.\\" Overly verbose help2man|
++ }' $f
++}
++
++trim_man_TH()
++{
++ # Handles lines like:
++ # .TH debhelper 7 "2010-02-27" "7.4.15" "Debhelper"
++ # .TH DIRMNGR-CLIENT 1 2010-02-27 "Dirmngr 1.0.3" "GNU Privacy Guard"
++ # .TH ccmake 1 "March 06, 2010" "ccmake 2.8.1-rc3"
++ # .TH QEMU-IMG 1 "2010-03-14" " " " "
++ # .TH kdecmake 1 "May 07, 2010" "cmake 2.8.1"
++ # .TH "appender.h" 3 "12 May 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
++ # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
++ # .TH "OFFLINEIMAP" "1" "11 May 2010" "John Goerzen" "OfflineIMAP Manual"
++ # .TH gv 3guile "13 May 2010"
++ #.TH "GIT\-ARCHIMPORT" "1" "09/13/2010" "Git 1\&.7\&.1" "Git Manual"
++ # .TH LDIRECTORD 8 "2010-10-20" "perl v5.12.2" "User Contributed Perl Documentation"
++ # .TH ccmake 1 "February 05, 2012" "ccmake 2.8.7"
++ # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
++ # .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands"
++ # .TH "GCM-CALIBRATE" "1" "03 February 2012" "" ""
++ #.TH Locale::Po4a::Xml.pm 3pm "2015-01-30" "Po4a Tools" "Po4a Tools"
++ local f=$1
++ # (.TH quoted section) (quoted_date)(*)
++ sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "qq2000-01-01"\3|' $f
++ # (.TH unquoted section) (quoted_date)(*)
++ sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "uq2000-02-02"\3|' $f
++ # (.TH quoted section) (unquoted_date)(*)
++ sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 qu2000-03-03\3|' $f
++ # (.TH unquoted section) (unquoted_date)(*)
++ sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 uu2000-04-04\3|' $f
++}
++
++strip_numbered_anchors()
++{
++ # Remove numbered anchors on Docbook / HTML files.
++ # This should be save since we remove them from old and new files.
++ # A trailing </a> or </div> tag will stay also on both files.
++ for f in old/$file new/$file; do
++ sed -i -e 's%<[ ]*a[ ]\+name[^<]*[0-9]\+[^<]*%%g' \
++ -e 's%<[ ]*a[ ]\+href[^<]*#[^<]*[0-9]\+[^<]*%%g' \
++ -e 's%<[^<]*id="ftn\.[^<]*[0-9]\+[^<]*%%g' $f
++ done
++}
++
++
++check_compressed_file()
++{
++ local file=$1
++ local ext=$2
++ local tmpdir=`mktemp -d`
++ local ftype
++ local ret=0
++ echo "$ext file with odd filename: $file"
++ if test -n "$tmpdir"; then
++ mkdir $tmpdir/{old,new}
++ cp --parents --dereference old/$file $tmpdir/
++ cp --parents --dereference new/$file $tmpdir/
++ if pushd $tmpdir > /dev/null ; then
++ case "$ext" in
++ bz2)
++ mv old/$file{,.bz2}
++ mv new/$file{,.bz2}
++ bzip2 -d old/$file.bz2
++ bzip2 -d new/$file.bz2
++ ;;
++ gzip)
++ mv old/$file{,.gz}
++ mv new/$file{,.gz}
++ gzip -d old/$file.gz
++ gzip -d new/$file.gz
++ ;;
++ xz)
++ mv old/$file{,.xz}
++ mv new/$file{,.xz}
++ xz -d old/$file.xz
++ xz -d new/$file.xz
++ ;;
++ esac
++ ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'`
++ case $ftype in
++ POSIX\ tar\ archive)
++ echo "$ext content is: $ftype"
++ mv old/$file{,.tar}
++ mv new/$file{,.tar}
++ if ! check_single_file ${file}.tar; then
++ ret=1
++ fi
++ ;;
++ ASCII\ cpio\ archive\ *)
++ echo "$ext content is: $ftype"
++ mv old/$file{,.cpio}
++ mv new/$file{,.cpio}
++ if ! check_single_file ${file}.cpio; then
++ ret=1
++ fi
++ ;;
++ *)
++ echo "unhandled $ext content: $ftype"
++ if ! diff_two_files; then
++ ret=1
++ fi
++ ;;
++ esac
++ popd > /dev/null
++ fi
++ rm -rf "$tmpdir"
++ fi
++ return $ret
++}
++
++check_single_file()
++{
++ local file="$1"
++ case $file in
++ *.spec)
++ sed -i -e "s,Release:.*$release1,Release: @RELEASE@," old/$file
++ sed -i -e "s,Release:.*$release2,Release: @RELEASE@," new/$file
++ ;;
++ *.exe.mdb|*.dll.mdb)
++ # Just debug information, we can skip them
++ echo "$file skipped as debug file."
++ return 0
++ ;;
++ *.a)
++ flist=`ar t new/$file`
++ pwd=$PWD
++ fdir=`dirname $file`
++ cd old/$fdir
++ ar x `basename $file`
++ cd $pwd/new/$fdir
++ ar x `basename $file`
++ cd $pwd
++ for f in $flist; do
++ if ! check_single_file $fdir/$f; then
++ return 1
++ fi
++ done
++ return 0
++ ;;
++ *.cpio)
++ flist=`cpio --quiet --list --force-local < "new/$file"`
++ pwd=$PWD
++ fdir=$file.extract.$PPID.$$
++ mkdir old/$fdir new/$fdir
++ cd old/$fdir
++ cpio --quiet --extract --force-local < "../${file##*/}"
++ cd $pwd/new/$fdir
++ cpio --quiet --extract --force-local < "../${file##*/}"
++ cd $pwd
++ local ret=0
++ for f in $flist; do
++ if ! check_single_file $fdir/$f; then
++ ret=1
++ if test -z "$check_all"; then
++ break
++ fi
++ fi
++ done
++ rm -rf old/$fdir new/$fdir
++ return $ret
++ ;;
++ *.tar|*.tar.bz2|*.tar.gz|*.tgz|*.tbz2)
++ flist=`tar tf new/$file`
++ pwd=$PWD
++ fdir=`dirname $file`
++ cd old/$fdir
++ tar xf `basename $file`
++ cd $pwd/new/$fdir
++ tar xf `basename $file`
++ cd $pwd
++ local ret=0
++ for f in $flist; do
++ if ! check_single_file $fdir/$f; then
++ ret=1
++ if test -z "$check_all"; then
++ break
++ fi
++ fi
++ done
++ return $ret
++ ;;
++ *.zip|*.jar|*.war)
++ cd old
++ unjar_l ./$file |sort > flist
++ # 10-05-2010 14:39
++ sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ," flist
++ # 2012-02-03 07:59
++ sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
++ cd ../new
++ unjar_l ./$file |sort> flist
++ sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ,; " flist
++ sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
++ cd ..
++ if ! cmp -s old/flist new/flist; then
++ echo "$file has different file list"
++ diff -u old/flist new/flist
++ return 1
++ fi
++ flist=`grep date new/flist | sed -e 's,.* date ,,'`
++ pwd=$PWD
++ fdir=`dirname $file`
++ cd old/$fdir
++ unjar `basename $file`
++ cd $pwd/new/$fdir
++ unjar `basename $file`
++ cd $pwd
++ local ret=0
++ for f in $flist; do
++ if test -f new/$fdir/$f && ! check_single_file $fdir/$f; then
++ ret=1
++ if test -z "$check_all"; then
++ break
++ fi
++ fi
++ done
++ return $ret;;
++ *.pyc|*.pyo)
++ perl -e "open fh, '+<', 'old/$file'; seek fh, 4, SEEK_SET; print fh '0000';"
++ perl -e "open fh, '+<', 'new/$file'; seek fh, 4, SEEK_SET; print fh '0000';"
++ ;;
++ *.bz2)
++ bunzip2 -c old/$file > old/${file/.bz2/}
++ bunzip2 -c new/$file > new/${file/.bz2/}
++ check_single_file ${file/.bz2/}
++ return $?
++ ;;
++ *.gz)
++ gunzip -c old/$file > old/${file/.gz/}
++ gunzip -c new/$file > new/${file/.gz/}
++ check_single_file ${file/.gz/}
++ return $?
++ ;;
++ *.rpm)
++ $self_script -a old/$file new/$file
++ return $?
++ ;;
++ *png)
++ # Try to remove timestamps, only if convert from ImageMagick is installed
++ if [[ $(type -p convert) ]]; then
++ convert old/$file +set date:create +set date:modify old/${file/.png/_n.png}
++ convert old/$file +set date:create +set date:modify new/${file/.png/_n.png}
++ if ! cmp -s old/${file/.png/_n.png} new/${file/.png/_n.png}; then
++ echo "$file differs ($ftype)"
++ hexdump -C old/${file/.png/_n.png} > $file1
++ hexdump -C new/${file/.png/_n.png} > $file2
++ diff -u $file1 $file2 | head -n 20
++ return 1
++ fi
++ return 0
++ fi
++ ;;
++ /usr/share/locale/*/LC_MESSAGES/*.mo|/usr/share/locale-bundle/*/LC_MESSAGES/*.mo)
++ for f in old/$file new/$file; do
++ sed -i -e "s,POT-Creation-Date: ....-..-.. ..:..+....,POT-Creation-Date: 1970-01-01 00:00+0000," $f
++ done
++ ;;
++ /usr/share/doc/packages/*/*.html|\
++ /usr/share/doc/kde/HTML/*/*/*.html|/usr/share/doc/*/html/*.html)
++ for f in old/$file new/$file; do
++ # texi2html output, e.g. in kvm, indent, qemu
++ sed -i -e "s|^<!-- Created on .*, 20.. by texi2html .\...|<!-- Created on August 7, 2009 by texi2html 1.82|" $f
++ sed -i -e 's|^ *This document was generated by <em>Autobuild</em> on <em>.*, 20..</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html .\...</em></a>.$| This document was generated by <em>Autobuild</em> on <em>August 7, 2009</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.|' $f
++ # doxygen docu, e.g. in libssh and log4c
++ sed -i -e 's|Generated on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] 20[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
++ # Generated on Sat Aug 14 2010 16:49:48 for libssh
++ sed -i -e 's|Generated on ... ... [0-9]* 20[0-9][0-9] [0-9]*:[0-9][0-9]:[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
++ done
++ strip_numbered_anchors
++ ;;
++ /usr/share/javadoc/*.html |\
++ /usr/share/javadoc/*/*.html|/usr/share/javadoc/*/*/*.html)
++ strip_numbered_anchors
++ # There are more timestamps in html, so far we handle only some primitive versions.
++ for f in old/$file new/$file; do
++ # Javadoc:
++ # <head>
++ # <!-- Generated by javadoc (version 1.7.0_75) on Tue Feb 03 02:20:12 GMT 2015 -->
++ # <!-- Generated by javadoc on Tue Feb 03 00:02:48 GMT 2015 -->
++ # <meta name="date" content="2015-02-03">
++ # </head>
++ sed -i -e '
++ /^<head>/{
++ : next
++ n
++ /^<\/head>/{
++ b end_head
++ }
++ s/^\(<!-- Generated by javadoc\) \((\(build\|version\) [0-9._]\+) on ... ... .. ..:..:.. \(GMT\|UTC\) ....\) \(-->\)/\1 some-date-removed-by-build-compare \5/
++ t next
++ s/^\(<!-- Generated by javadoc\) \(on ... ... .. ..:..:.. \(GMT\|UTC\) ....\) \(-->\)/\1 some-date-removed-by-build-compare \3/
++ t next
++ s/^<meta name="date" content="[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}">/<meta name="date" content="some-date-removed-by-build-compare">/
++ b next
++ }
++ : end_head
++ ' $f
++ # Gjdoc HtmlDoclet:
++ sed -i -e 's%Generated by Gjdoc HtmlDoclet [0-9,.]*, part of <a href="http://www.gnu.org/software/classpath/cp-tools/" title="" target="_top">GNU Classpath Tools</a>, on .*, 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.%Generated by Gjdoc.%' $f
++ sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\(.*\)GNU Classpath Tools</a>, on [A-Z][a-z]* [0-9]*, 20?? [0-9]*:??:?? \(a|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\1GNU Classpath Tools</a>, on January 1, 2009 0:00:00 a.m. GMT.</p>%' $f
++ sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\(.*GNU Classpath Tools</a>\), on [a-zA-Z]* [0-9][0-9], 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\1,on May 1, 2010 1:11:42 p.m. GMT.</p>%' $f
++ # deprecated-list is randomly ordered, sort it for comparison
++ case $f in
++ */deprecated-list.html)
++ sort -o $f $f
++ ;;
++ esac
++ done
++ ;;
++ /usr/share/javadoc/gjdoc.properties |\
++ /usr/share/javadoc/*/gjdoc.properties)
++ for f in old/$file new/$file; do
++ sed -i -e 's|^#[A-Z][a-z]\{2\} [A-Z][a-z]\{2\} [0-9]\{2\} ..:..:.. GMT 20..$|#Fri Jan 01 11:27:36 GMT 2009|' $f
++ done
++ ;;
++ */fonts.scale|*/fonts.dir|*/encodings.dir)
++ for f in old/$file new/$file; do
++ # sort files before comparing
++ sort -o $f $f
++ done
++ ;;
++ /var/adm/perl-modules/*)
++ for f in old/$file new/$file; do
++ sed -i -e 's|^=head2 ... ... .. ..:..:.. ....: C<Module>|=head2 Wed Jul 1 00:00:00 2009: C<Module>|' $f
++ done
++ ;;
++ /usr/share/man/man3/*3pm)
++ for f in old/$file new/$file; do
++ sed -i -e 's| 3 "20..-..-.." "perl v5....." "User Contributed Perl Documentation"$| 3 "2009-01-01" "perl v5.10.0" "User Contributed Perl Documentation"|' $f
++ trim_man_TH $f
++ trim_man_first_line $f
++ done
++ ;;
++ /usr/share/man/*/man*|/usr/share/man/man*|/usr/lib/texmf/doc/man/*/*)
++
++ for f in old/$file new/$file; do
++ trim_man_TH $f
++ trim_man_first_line $f
++ # generated by docbook xml:
++ #.\" Date: 09/13/2010
++ sed -i -e 's|Date: [0-1][0-9]/[0-9][0-9]/201[0-9]|Date: 09/13/2010|' $f
++ done
++ ;;
++ *.elc)
++ # emacs lisp files
++ for f in old/$file new/$file; do
++ sed -i -e 's|Compiled by abuild@.* on ... ... .. ..:..:.. 20..$|compiled by abuild@buildhost on Wed Jul 01 00:00:00 2009|' $f
++ done
++ ;;
++ /var/lib/texmf/web2c/*/*fmt |\
++ /var/lib/texmf/web2c/metafont/*.base|\
++ /var/lib/texmf/web2c/metapost/*.mem)
++ # binary dump of TeX and Metafont formats, we can ignore them for good
++ echo "difference in $file ignored."
++ return 0
++ ;;
++ */libtool)
++ for f in old/$file new/$file; do
++ sed -i -e 's|^# Libtool was configured on host [A-Za-z0-9]*:$|# Libtool was configured on host x42:|' $f
++ done
++ ;;
++ /etc/mail/*cf|/etc/sendmail.cf)
++ # from sendmail package
++ for f in old/$file new/$file; do
++ # - ##### built by abuild@build33 on Thu May 6 11:21:17 UTC 2010
++ sed -i -e 's|built by abuild@[a-z0-9]* on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] .* 20[0-9][0-9]|built by abuild@build42 on Thu May 6 11:21:17 UTC 2010|' $f
++ done
++ ;;
++ /usr/share/doc/kde/HTML/*/*/index.cache|/usr/share/doc/kde/HTML/*/*/*/index.cache|\
++ /usr/share/gtk-doc/html/*/*.html|/usr/share/gtk-doc/html/*/*.devhelp2)
++ # various kde and gtk packages
++ strip_numbered_anchors
++ ;;
++ */created.rid)
++ # ruby documentation
++ # file just contains a timestamp and nothing else, so ignore it
++ echo "Ignore $file"
++ return 0
++ ;;
++ */rdoc/files/*.html)
++ # ruby documentation
++ # <td>Mon Sep 20 19:02:43 +0000 2010</td>
++ for f in old/$file new/$file; do
++ sed -i -e 's%<td>[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]\+ [0-9]\+:[0-9]\+:[0-9]\+ +0000 201[0-9]</td>%<td>Mon Sep 20 19:02:43 +0000 2010</td>%g' $f
++ done
++ strip_numbered_anchors
++ ;;
++ */Linux*Env.Set.sh)
++ # LibreOffice files, contains:
++ # Generated on: Mon Apr 18 13:19:22 UTC 2011
++ for f in old/$file new/$file; do
++ sed -i -e 's%^# Generated on:.*UTC 201[0-9] *$%# Generated on: Sometime%g' $f
++ done
++ ;;
++ /usr/lib/libreoffice/solver/inc/*/deliver.log)
++ # LibreOffice log file
++ echo "Ignore $file"
++ return 0
++ ;;
++ /var/adm/update-messages/*|/var/adm/update-scripts/*)
++ # encode version-release inside
++ oldfn=`echo "$file"|sed -e s/-$release2/-$release1/;`
++
++ # fetchmsttfonts embeds the release number in the update shell script.
++ echo sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
++ sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
++
++ if ! diff -u old/$oldfn new/$file; then
++ echo "$oldfn is not same as $file"
++ return 1
++ fi
++ echo "$file and $oldfn are same"
++ return 0
++ ;;
++ *.ps)
++ for f in "old/$file" "new/$file"; do
++ sed -i -e '
++ /^%%CreationDate:[[:blank:]]/d
++ /^%%Creator:[[:blank:]]groff[[:blank:]]version[[:blank:]]/d
++ /^%DVIPSSource:[[:blank:]]/d
++ ' "$f"
++ done
++ ;;
++ *pdf)
++ # PDF files contain a unique ID, remove it
++ # Format of the ID is:
++ # /ID [<9ACE247A70CF9BEAFEE15E116259BD6D> <9ACE247A70CF9BEAFEE15E116259BD6D>]
++ # with optional spaces. pdftex creates also:
++ # /CreationDate (D:20120103083206Z)
++ # /ModDate (D:20120103083206Z)
++ # and possibly XML metadata as well
++ for f in "old/$file" "new/$file"; do
++ sed -i \
++ '/obj/,/endobj/{
++ s%/ID \?\[ \?<[^>]\+> \?<[^>]\+> \?\]%/IDrandom%g;
++ s%/CreationDate \?(D:[^)]*)%/CreationDate (D: XXX)%g;
++ s%/ModDate \?(D:[^)]*)%/ModDate (D: XXX)%g;
++ s%<pdf:CreationDate>[^<]*</pdf:CreationDate>%<pdf:CreationDate>XXX</pdf:CreationDate>%g;
++ s%<pdf:ModDate>[^<]*</pdf:ModDate>%<pdf:ModDate>XXX</pdf:ModDate>%g;
++ s%<xap:CreateDate>[^<]*</xap:CreateDate>%<xap:CreateDate>XXX</xap:CreateDate>%g;
++ s%<xap:ModifyDate>[^<]*</xap:ModifyDate>%<xap:ModifyDate>XXX</xap:ModifyDate>%g;
++ s%<xap:MetadataDate>[^<]*</xap:MetadataDate>%<xap:MetadataDate>XXX</xap:MetadataDate>%g;
++ }' "$f"
++ done
++ ;;
++ esac
++
++ ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'`
++ case $ftype in
++ PE32\ executable*Mono\/\.Net\ assembly*)
++ echo "PE32 Mono/.Net assembly: $file"
++ if [ -x /usr/bin/monodis ] ; then
++ monodis old/$file 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file1}
++ monodis new/$file 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file2}
++ if ! cmp -s ${file1} ${file2}; then
++ echo "$file differs ($ftype)"
++ diff -u ${file1} ${file2}
++ return 1
++ fi
++ else
++ echo "Cannot compare, no monodis installed"
++ return 1
++ fi
++ ;;
++ ELF*executable*|ELF*[LM]SB\ shared\ object*)
++ objdump -d --no-show-raw-insn old/$file | filter_disasm > $file1
++ if ! test -s $file1; then
++ # objdump has no idea how to handle it
++ if ! diff_two_files; then
++ ret=1
++ break
++ fi
++ fi
++ elfdiff=
++ sed -i -e "s,old/,," $file1
++ objdump -d --no-show-raw-insn new/$file | filter_disasm > $file2
++ sed -i -e "s,new/,," $file2
++ if ! diff -u $file1 $file2 > $dfile; then
++ echo "$file differs in assembler output"
++ head -n 200 $dfile
++ elfdiff="1"
++ fi
++ echo "" >$file1
++ echo "" >$file2
++ # Don't compare .build-id and .gnu_debuglink sections
++ sections="$(objdump -s new/$file | grep "Contents of section .*:" | sed -r "s,.* (.*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" | tr "\n" " ")"
++ for section in $sections; do
++ objdump -s -j $section old/$file | sed "s,^old/,," > $file1
++ objdump -s -j $section new/$file | sed "s,^new/,," > $file2
++ if ! diff -u $file1 $file2 > $dfile; then
++ echo "$file differs in ELF section $section"
++ head -n 200 $dfile
++ elfdiff="1"
++ fi
++ done
++ if test -z "$elfdiff"; then
++ echo "$file: only difference was in build-id or gnu_debuglink, GOOD."
++ return 0
++ fi
++ return 1
++ ;;
++ *ASCII*|*text*)
++ if ! cmp -s old/$file new/$file; then
++ echo "$file differs ($ftype)"
++ diff -u old/$file new/$file | head -n 200
++ return 1
++ fi
++ ;;
++ directory|setuid,\ directory|sticky,\ directory)
++ # tar might package directories - ignore them here
++ return 0
++ ;;
++ bzip2\ compressed\ data*)
++ if ! check_compressed_file "$file" "bz2"; then
++ return 1
++ fi
++ ;;
++ gzip\ compressed\ data*)
++ if ! check_compressed_file "$file" "gzip"; then
++ return 1
++ fi
++ ;;
++ XZ\ compressed\ data*)
++ if ! check_compressed_file "$file" "xz"; then
++ return 1
++ fi
++ ;;
++ POSIX\ tar\ archive)
++ mv old/$file{,.tar}
++ mv new/$file{,.tar}
++ if ! check_single_file ${file}.tar; then
++ return 1
++ fi
++ ;;
++ cpio\ archive)
++ mv old/$file{,.cpio}
++ mv new/$file{,.cpio}
++ if ! check_single_file ${file}.cpio; then
++ return 1
++ fi
++ ;;
++ symbolic\ link\ to\ *)
++ readlink "old/$file" > $file1
++ readlink "new/$file" > $file2
++ if ! diff -u $file1 $file2; then
++ echo "symlink target for $file differs"
++ return 1
++ fi
++ ;;
++ *)
++ if ! diff_two_files; then
++ return 1
++ fi
++ ;;
++ esac
++ return 0
++}
++
++# We need /proc mounted for some tests, so check that it's mounted and
++# complain if not.
++PROC_MOUNTED=0
++if [ ! -d /proc/self/ ]; then
++ echo "/proc is not mounted"
++ mount -orw -n -tproc none /proc
++ PROC_MOUNTED=1
++fi
++
++# preserve cmp_spec result for check_all runs
++ret=$RES
++for file in $files; do
++ if ! check_single_file $file; then
++ ret=1
++ if test -z "$check_all"; then
++ break
++ fi
++ fi
++done
++
++if [ "$PROC_MOUNTED" -eq "1" ]; then
++ echo "Unmounting proc"
++ umount /proc
++fi
++
++rm $file1 $file2 $dfile $rename_script
++rm -rf $dir
++if test "$ret" = 0; then
++ echo "Package content is identical"
++fi
++exit $ret
++# vim: tw=666 ts=2 et
+diff --git a/rpm-check.sh b/rpm-check.sh
+deleted file mode 100755
+index dd47642..0000000
+--- a/rpm-check.sh
++++ /dev/null
+@@ -1,764 +0,0 @@
+-#! /bin/bash
+-#
+-# Copyright (c) 2009, 2010, 2011, 2012 SUSE Linux Product GmbH, Germany.
+-# Licensed under GPL v2, see COPYING file for details.
+-#
+-# Written by Michael Matz and Stephan Coolo
+-# Enhanced by Andreas Jaeger
+-
+-FUNCTIONS=${0%/*}/functions.sh
+-
+-check_all=
+-case $1 in
+- -a | --check-all)
+- check_all=1
+- shift
+-esac
+-
+-if test "$#" != 2; then
+- echo "usage: $0 [-a|--check-all] old.rpm new.rpm"
+- exit 1
+-fi
+-
+-self_script=$(cd $(dirname $0); echo $(pwd)/$(basename $0))
+-
+-source $FUNCTIONS
+-
+-oldpkg=`readlink -f $1`
+-newpkg=`readlink -f $2`
+-rename_script=`mktemp`
+-
+-if test ! -f "$oldpkg"; then
+- echo "can't open $1"
+- exit 1
+-fi
+-
+-if test ! -f "$newpkg"; then
+- echo "can't open $2"
+- exit 1
+-fi
+-
+-#usage unjar <file>
+-function unjar()
+-{
+- local file
+- file=$1
+-
+- if [[ $(type -p fastjar) ]]; then
+- UNJAR=fastjar
+- elif [[ $(type -p jar) ]]; then
+- UNJAR=jar
+- elif [[ $(type -p unzip) ]]; then
+- UNJAR=unzip
+- else
+- echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
+- exit 1
+- fi
+-
+- case $UNJAR in
+- jar|fastjar)
+- # echo jar -xf $file
+- ${UNJAR} -xf $file
+- ;;
+- unzip)
+- unzip -oqq $file
+- ;;
+- esac
+-}
+-
+-# list files in directory
+-#usage unjar_l <file>
+-function unjar_l()
+-{
+- local file
+- file=$1
+-
+- if [[ $(type -p fastjar) ]]; then
+- UNJAR=fastjar
+- elif [[ $(type -p jar) ]]; then
+- UNJAR=jar
+- elif [[ $(type -p unzip) ]]; then
+- UNJAR=unzip
+- else
+- echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
+- exit 1
+- fi
+-
+- case $UNJAR in
+- jar|fastjar)
+- ${UNJAR} -tf $file
+- ;;
+- unzip)
+- unzip -l $file
+- ;;
+- esac
+-}
+-
+-filter_disasm()
+-{
+- sed -e 's/^ *[0-9a-f]\+://' -e 's/\$0x[0-9a-f]\+/$something/' -e 's/callq *[0-9a-f]\+/callq /' -e 's/# *[0-9a-f]\+/# /' -e 's/\(0x\)\?[0-9a-f]\+(/offset(/' -e 's/[0-9a-f]\+ </</' -e 's/^<\(.*\)>:/\1:/' -e 's/<\(.*\)+0x[0-9a-f]\+>/<\1 + ofs>/'
+-}
+-
+-echo "Comparing `basename $oldpkg` to `basename $newpkg`"
+-
+-case $oldpkg in
+- *.rpm)
+- cmp_spec $rename_script $oldpkg $newpkg
+- RES=$?
+- case $RES in
+- 0)
+- echo "RPM meta information is identical"
+- if test -z "$check_all"; then
+- exit 0
+- fi
+- ;;
+- 1)
+- echo "RPM meta information is different"
+- if test -z "$check_all"; then
+- exit 1
+- fi
+- ;;
+- 2)
+- echo "RPM file checksum differs."
+- RES=0
+- ;;
+- *)
+- echo "Wrong exit code!"
+- exit 1
+- ;;
+- esac
+- ;;
+-esac
+-
+-file1=`mktemp`
+-file2=`mktemp`
+-
+-dir=`mktemp -d`
+-echo "Extracting packages"
+-unpackage $oldpkg $dir/old
+-unpackage $newpkg $dir/new
+-
+-# files is set in cmp_spec for rpms, so if RES is empty we should assume
+-# it wasn't an rpm and pick all files for comparison.
+-if [ -z $RES ]; then
+- oldfiles=`cd $dir/old; find . -type f`
+- newfiles=`cd $dir/new; find . -type f`
+-
+- files=`echo -e "$oldfiles\n$newfiles" | sort -u`
+-fi
+-
+-cd $dir
+-bash $rename_script
+-
+-dfile=`mktemp`
+-
+-diff_two_files()
+-{
+- if ! cmp -s old/$file new/$file; then
+- echo "$file differs ($ftype)"
+- hexdump -C old/$file > $file1
+- hexdump -C new/$file > $file2
+- diff -u $file1 $file2 | head -n 200
+- return 1
+- fi
+- return 0
+-}
+-
+-trim_man_first_line()
+-{
+- # Handles the first line if it is like:
+- #.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
+- #.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.43.3.
+- local f=$1
+- sed -i -e '1{
+- s|^\.\\"[[:blank:]]\+Automatically[[:blank:]]generated[[:blank:]]by[[:blank:]]Pod::Man[[:blank:]].*|.\\" Overly verbose Pod::Man|
+- s|^\.\\"[[:blank:]]\+DO[[:blank:]]NOT[[:blank:]]MODIFY[[:blank:]]THIS[[:blank:]]FILE![[:blank:]]\+It[[:blank:]]was[[:blank:]]generated[[:blank:]]by[[:blank:]]help2man[[:blank:]].*|.\\" Overly verbose help2man|
+- }' $f
+-}
+-
+-trim_man_TH()
+-{
+- # Handles lines like:
+- # .TH debhelper 7 "2010-02-27" "7.4.15" "Debhelper"
+- # .TH DIRMNGR-CLIENT 1 2010-02-27 "Dirmngr 1.0.3" "GNU Privacy Guard"
+- # .TH ccmake 1 "March 06, 2010" "ccmake 2.8.1-rc3"
+- # .TH QEMU-IMG 1 "2010-03-14" " " " "
+- # .TH kdecmake 1 "May 07, 2010" "cmake 2.8.1"
+- # .TH "appender.h" 3 "12 May 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
+- # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
+- # .TH "OFFLINEIMAP" "1" "11 May 2010" "John Goerzen" "OfflineIMAP Manual"
+- # .TH gv 3guile "13 May 2010"
+- #.TH "GIT\-ARCHIMPORT" "1" "09/13/2010" "Git 1\&.7\&.1" "Git Manual"
+- # .TH LDIRECTORD 8 "2010-10-20" "perl v5.12.2" "User Contributed Perl Documentation"
+- # .TH ccmake 1 "February 05, 2012" "ccmake 2.8.7"
+- # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
+- # .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands"
+- # .TH "GCM-CALIBRATE" "1" "03 February 2012" "" ""
+- #.TH Locale::Po4a::Xml.pm 3pm "2015-01-30" "Po4a Tools" "Po4a Tools"
+- local f=$1
+- # (.TH quoted section) (quoted_date)(*)
+- sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "qq2000-01-01"\3|' $f
+- # (.TH unquoted section) (quoted_date)(*)
+- sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "uq2000-02-02"\3|' $f
+- # (.TH quoted section) (unquoted_date)(*)
+- sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 qu2000-03-03\3|' $f
+- # (.TH unquoted section) (unquoted_date)(*)
+- sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 uu2000-04-04\3|' $f
+-}
+-
+-strip_numbered_anchors()
+-{
+- # Remove numbered anchors on Docbook / HTML files.
+- # This should be save since we remove them from old and new files.
+- # A trailing </a> or </div> tag will stay also on both files.
+- for f in old/$file new/$file; do
+- sed -i -e 's%<[ ]*a[ ]\+name[^<]*[0-9]\+[^<]*%%g' \
+- -e 's%<[ ]*a[ ]\+href[^<]*#[^<]*[0-9]\+[^<]*%%g' \
+- -e 's%<[^<]*id="ftn\.[^<]*[0-9]\+[^<]*%%g' $f
+- done
+-}
+-
+-
+-check_compressed_file()
+-{
+- local file=$1
+- local ext=$2
+- local tmpdir=`mktemp -d`
+- local ftype
+- local ret=0
+- echo "$ext file with odd filename: $file"
+- if test -n "$tmpdir"; then
+- mkdir $tmpdir/{old,new}
+- cp --parents --dereference old/$file $tmpdir/
+- cp --parents --dereference new/$file $tmpdir/
+- if pushd $tmpdir > /dev/null ; then
+- case "$ext" in
+- bz2)
+- mv old/$file{,.bz2}
+- mv new/$file{,.bz2}
+- bzip2 -d old/$file.bz2
+- bzip2 -d new/$file.bz2
+- ;;
+- gzip)
+- mv old/$file{,.gz}
+- mv new/$file{,.gz}
+- gzip -d old/$file.gz
+- gzip -d new/$file.gz
+- ;;
+- xz)
+- mv old/$file{,.xz}
+- mv new/$file{,.xz}
+- xz -d old/$file.xz
+- xz -d new/$file.xz
+- ;;
+- esac
+- ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'`
+- case $ftype in
+- POSIX\ tar\ archive)
+- echo "$ext content is: $ftype"
+- mv old/$file{,.tar}
+- mv new/$file{,.tar}
+- if ! check_single_file ${file}.tar; then
+- ret=1
+- fi
+- ;;
+- ASCII\ cpio\ archive\ *)
+- echo "$ext content is: $ftype"
+- mv old/$file{,.cpio}
+- mv new/$file{,.cpio}
+- if ! check_single_file ${file}.cpio; then
+- ret=1
+- fi
+- ;;
+- *)
+- echo "unhandled $ext content: $ftype"
+- if ! diff_two_files; then
+- ret=1
+- fi
+- ;;
+- esac
+- popd > /dev/null
+- fi
+- rm -rf "$tmpdir"
+- fi
+- return $ret
+-}
+-
+-check_single_file()
+-{
+- local file="$1"
+- case $file in
+- *.spec)
+- sed -i -e "s,Release:.*$release1,Release: @RELEASE@," old/$file
+- sed -i -e "s,Release:.*$release2,Release: @RELEASE@," new/$file
+- ;;
+- *.exe.mdb|*.dll.mdb)
+- # Just debug information, we can skip them
+- echo "$file skipped as debug file."
+- return 0
+- ;;
+- *.a)
+- flist=`ar t new/$file`
+- pwd=$PWD
+- fdir=`dirname $file`
+- cd old/$fdir
+- ar x `basename $file`
+- cd $pwd/new/$fdir
+- ar x `basename $file`
+- cd $pwd
+- for f in $flist; do
+- if ! check_single_file $fdir/$f; then
+- return 1
+- fi
+- done
+- return 0
+- ;;
+- *.cpio)
+- flist=`cpio --quiet --list --force-local < "new/$file"`
+- pwd=$PWD
+- fdir=$file.extract.$PPID.$$
+- mkdir old/$fdir new/$fdir
+- cd old/$fdir
+- cpio --quiet --extract --force-local < "../${file##*/}"
+- cd $pwd/new/$fdir
+- cpio --quiet --extract --force-local < "../${file##*/}"
+- cd $pwd
+- local ret=0
+- for f in $flist; do
+- if ! check_single_file $fdir/$f; then
+- ret=1
+- if test -z "$check_all"; then
+- break
+- fi
+- fi
+- done
+- rm -rf old/$fdir new/$fdir
+- return $ret
+- ;;
+- *.tar|*.tar.bz2|*.tar.gz|*.tgz|*.tbz2)
+- flist=`tar tf new/$file`
+- pwd=$PWD
+- fdir=`dirname $file`
+- cd old/$fdir
+- tar xf `basename $file`
+- cd $pwd/new/$fdir
+- tar xf `basename $file`
+- cd $pwd
+- local ret=0
+- for f in $flist; do
+- if ! check_single_file $fdir/$f; then
+- ret=1
+- if test -z "$check_all"; then
+- break
+- fi
+- fi
+- done
+- return $ret
+- ;;
+- *.zip|*.jar|*.war)
+- cd old
+- unjar_l ./$file |sort > flist
+- # 10-05-2010 14:39
+- sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ," flist
+- # 2012-02-03 07:59
+- sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
+- cd ../new
+- unjar_l ./$file |sort> flist
+- sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ,; " flist
+- sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
+- cd ..
+- if ! cmp -s old/flist new/flist; then
+- echo "$file has different file list"
+- diff -u old/flist new/flist
+- return 1
+- fi
+- flist=`grep date new/flist | sed -e 's,.* date ,,'`
+- pwd=$PWD
+- fdir=`dirname $file`
+- cd old/$fdir
+- unjar `basename $file`
+- cd $pwd/new/$fdir
+- unjar `basename $file`
+- cd $pwd
+- local ret=0
+- for f in $flist; do
+- if test -f new/$fdir/$f && ! check_single_file $fdir/$f; then
+- ret=1
+- if test -z "$check_all"; then
+- break
+- fi
+- fi
+- done
+- return $ret;;
+- *.pyc|*.pyo)
+- perl -e "open fh, '+<', 'old/$file'; seek fh, 4, SEEK_SET; print fh '0000';"
+- perl -e "open fh, '+<', 'new/$file'; seek fh, 4, SEEK_SET; print fh '0000';"
+- ;;
+- *.bz2)
+- bunzip2 -c old/$file > old/${file/.bz2/}
+- bunzip2 -c new/$file > new/${file/.bz2/}
+- check_single_file ${file/.bz2/}
+- return $?
+- ;;
+- *.gz)
+- gunzip -c old/$file > old/${file/.gz/}
+- gunzip -c new/$file > new/${file/.gz/}
+- check_single_file ${file/.gz/}
+- return $?
+- ;;
+- *.rpm)
+- $self_script -a old/$file new/$file
+- return $?
+- ;;
+- *png)
+- # Try to remove timestamps, only if convert from ImageMagick is installed
+- if [[ $(type -p convert) ]]; then
+- convert old/$file +set date:create +set date:modify old/${file/.png/_n.png}
+- convert old/$file +set date:create +set date:modify new/${file/.png/_n.png}
+- if ! cmp -s old/${file/.png/_n.png} new/${file/.png/_n.png}; then
+- echo "$file differs ($ftype)"
+- hexdump -C old/${file/.png/_n.png} > $file1
+- hexdump -C new/${file/.png/_n.png} > $file2
+- diff -u $file1 $file2 | head -n 20
+- return 1
+- fi
+- return 0
+- fi
+- ;;
+- /usr/share/locale/*/LC_MESSAGES/*.mo|/usr/share/locale-bundle/*/LC_MESSAGES/*.mo)
+- for f in old/$file new/$file; do
+- sed -i -e "s,POT-Creation-Date: ....-..-.. ..:..+....,POT-Creation-Date: 1970-01-01 00:00+0000," $f
+- done
+- ;;
+- /usr/share/doc/packages/*/*.html|\
+- /usr/share/doc/kde/HTML/*/*/*.html|/usr/share/doc/*/html/*.html)
+- for f in old/$file new/$file; do
+- # texi2html output, e.g. in kvm, indent, qemu
+- sed -i -e "s|^<!-- Created on .*, 20.. by texi2html .\...|<!-- Created on August 7, 2009 by texi2html 1.82|" $f
+- sed -i -e 's|^ *This document was generated by <em>Autobuild</em> on <em>.*, 20..</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html .\...</em></a>.$| This document was generated by <em>Autobuild</em> on <em>August 7, 2009</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.|' $f
+- # doxygen docu, e.g. in libssh and log4c
+- sed -i -e 's|Generated on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] 20[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
+- # Generated on Sat Aug 14 2010 16:49:48 for libssh
+- sed -i -e 's|Generated on ... ... [0-9]* 20[0-9][0-9] [0-9]*:[0-9][0-9]:[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
+- done
+- strip_numbered_anchors
+- ;;
+- /usr/share/javadoc/*.html |\
+- /usr/share/javadoc/*/*.html|/usr/share/javadoc/*/*/*.html)
+- strip_numbered_anchors
+- # There are more timestamps in html, so far we handle only some primitive versions.
+- for f in old/$file new/$file; do
+- # Javadoc:
+- # <head>
+- # <!-- Generated by javadoc (version 1.7.0_75) on Tue Feb 03 02:20:12 GMT 2015 -->
+- # <!-- Generated by javadoc on Tue Feb 03 00:02:48 GMT 2015 -->
+- # <meta name="date" content="2015-02-03">
+- # </head>
+- sed -i -e '
+- /^<head>/{
+- : next
+- n
+- /^<\/head>/{
+- b end_head
+- }
+- s/^\(<!-- Generated by javadoc\) \((\(build\|version\) [0-9._]\+) on ... ... .. ..:..:.. \(GMT\|UTC\) ....\) \(-->\)/\1 some-date-removed-by-build-compare \5/
+- t next
+- s/^\(<!-- Generated by javadoc\) \(on ... ... .. ..:..:.. \(GMT\|UTC\) ....\) \(-->\)/\1 some-date-removed-by-build-compare \3/
+- t next
+- s/^<meta name="date" content="[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}">/<meta name="date" content="some-date-removed-by-build-compare">/
+- b next
+- }
+- : end_head
+- ' $f
+- # Gjdoc HtmlDoclet:
+- sed -i -e 's%Generated by Gjdoc HtmlDoclet [0-9,.]*, part of <a href="http://www.gnu.org/software/classpath/cp-tools/" title="" target="_top">GNU Classpath Tools</a>, on .*, 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.%Generated by Gjdoc.%' $f
+- sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\(.*\)GNU Classpath Tools</a>, on [A-Z][a-z]* [0-9]*, 20?? [0-9]*:??:?? \(a|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\1GNU Classpath Tools</a>, on January 1, 2009 0:00:00 a.m. GMT.</p>%' $f
+- sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\(.*GNU Classpath Tools</a>\), on [a-zA-Z]* [0-9][0-9], 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\1,on May 1, 2010 1:11:42 p.m. GMT.</p>%' $f
+- # deprecated-list is randomly ordered, sort it for comparison
+- case $f in
+- */deprecated-list.html)
+- sort -o $f $f
+- ;;
+- esac
+- done
+- ;;
+- /usr/share/javadoc/gjdoc.properties |\
+- /usr/share/javadoc/*/gjdoc.properties)
+- for f in old/$file new/$file; do
+- sed -i -e 's|^#[A-Z][a-z]\{2\} [A-Z][a-z]\{2\} [0-9]\{2\} ..:..:.. GMT 20..$|#Fri Jan 01 11:27:36 GMT 2009|' $f
+- done
+- ;;
+- */fonts.scale|*/fonts.dir|*/encodings.dir)
+- for f in old/$file new/$file; do
+- # sort files before comparing
+- sort -o $f $f
+- done
+- ;;
+- /var/adm/perl-modules/*)
+- for f in old/$file new/$file; do
+- sed -i -e 's|^=head2 ... ... .. ..:..:.. ....: C<Module>|=head2 Wed Jul 1 00:00:00 2009: C<Module>|' $f
+- done
+- ;;
+- /usr/share/man/man3/*3pm)
+- for f in old/$file new/$file; do
+- sed -i -e 's| 3 "20..-..-.." "perl v5....." "User Contributed Perl Documentation"$| 3 "2009-01-01" "perl v5.10.0" "User Contributed Perl Documentation"|' $f
+- trim_man_TH $f
+- trim_man_first_line $f
+- done
+- ;;
+- /usr/share/man/*/man*|/usr/share/man/man*|/usr/lib/texmf/doc/man/*/*)
+-
+- for f in old/$file new/$file; do
+- trim_man_TH $f
+- trim_man_first_line $f
+- # generated by docbook xml:
+- #.\" Date: 09/13/2010
+- sed -i -e 's|Date: [0-1][0-9]/[0-9][0-9]/201[0-9]|Date: 09/13/2010|' $f
+- done
+- ;;
+- *.elc)
+- # emacs lisp files
+- for f in old/$file new/$file; do
+- sed -i -e 's|Compiled by abuild@.* on ... ... .. ..:..:.. 20..$|compiled by abuild@buildhost on Wed Jul 01 00:00:00 2009|' $f
+- done
+- ;;
+- /var/lib/texmf/web2c/*/*fmt |\
+- /var/lib/texmf/web2c/metafont/*.base|\
+- /var/lib/texmf/web2c/metapost/*.mem)
+- # binary dump of TeX and Metafont formats, we can ignore them for good
+- echo "difference in $file ignored."
+- return 0
+- ;;
+- */libtool)
+- for f in old/$file new/$file; do
+- sed -i -e 's|^# Libtool was configured on host [A-Za-z0-9]*:$|# Libtool was configured on host x42:|' $f
+- done
+- ;;
+- /etc/mail/*cf|/etc/sendmail.cf)
+- # from sendmail package
+- for f in old/$file new/$file; do
+- # - ##### built by abuild@build33 on Thu May 6 11:21:17 UTC 2010
+- sed -i -e 's|built by abuild@[a-z0-9]* on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] .* 20[0-9][0-9]|built by abuild@build42 on Thu May 6 11:21:17 UTC 2010|' $f
+- done
+- ;;
+- /usr/share/doc/kde/HTML/*/*/index.cache|/usr/share/doc/kde/HTML/*/*/*/index.cache|\
+- /usr/share/gtk-doc/html/*/*.html|/usr/share/gtk-doc/html/*/*.devhelp2)
+- # various kde and gtk packages
+- strip_numbered_anchors
+- ;;
+- */created.rid)
+- # ruby documentation
+- # file just contains a timestamp and nothing else, so ignore it
+- echo "Ignore $file"
+- return 0
+- ;;
+- */rdoc/files/*.html)
+- # ruby documentation
+- # <td>Mon Sep 20 19:02:43 +0000 2010</td>
+- for f in old/$file new/$file; do
+- sed -i -e 's%<td>[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]\+ [0-9]\+:[0-9]\+:[0-9]\+ +0000 201[0-9]</td>%<td>Mon Sep 20 19:02:43 +0000 2010</td>%g' $f
+- done
+- strip_numbered_anchors
+- ;;
+- */Linux*Env.Set.sh)
+- # LibreOffice files, contains:
+- # Generated on: Mon Apr 18 13:19:22 UTC 2011
+- for f in old/$file new/$file; do
+- sed -i -e 's%^# Generated on:.*UTC 201[0-9] *$%# Generated on: Sometime%g' $f
+- done
+- ;;
+- /usr/lib/libreoffice/solver/inc/*/deliver.log)
+- # LibreOffice log file
+- echo "Ignore $file"
+- return 0
+- ;;
+- /var/adm/update-messages/*|/var/adm/update-scripts/*)
+- # encode version-release inside
+- oldfn=`echo "$file"|sed -e s/-$release2/-$release1/;`
+-
+- # fetchmsttfonts embeds the release number in the update shell script.
+- echo sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
+- sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
+-
+- if ! diff -u old/$oldfn new/$file; then
+- echo "$oldfn is not same as $file"
+- return 1
+- fi
+- echo "$file and $oldfn are same"
+- return 0
+- ;;
+- *.ps)
+- for f in "old/$file" "new/$file"; do
+- sed -i -e '
+- /^%%CreationDate:[[:blank:]]/d
+- /^%%Creator:[[:blank:]]groff[[:blank:]]version[[:blank:]]/d
+- ' "$f"
+- done
+- ;;
+- *pdf)
+- # PDF files contain a unique ID, remove it
+- # Format of the ID is:
+- # /ID [<9ACE247A70CF9BEAFEE15E116259BD6D> <9ACE247A70CF9BEAFEE15E116259BD6D>]
+- # with optional spaces. pdftex creates also:
+- # /CreationDate (D:20120103083206Z)
+- # /ModDate (D:20120103083206Z)
+- # and possibly XML metadata as well
+- for f in "old/$file" "new/$file"; do
+- sed -i \
+- '/obj/,/endobj/{
+- s%/ID \?\[ \?<[^>]\+> \?<[^>]\+> \?\]%/IDrandom%g;
+- s%/CreationDate \?(D:[^)]*)%/CreationDate (D: XXX)%g;
+- s%/ModDate \?(D:[^)]*)%/ModDate (D: XXX)%g;
+- s%<pdf:CreationDate>[^<]*</pdf:CreationDate>%<pdf:CreationDate>XXX</pdf:CreationDate>%g;
+- s%<pdf:ModDate>[^<]*</pdf:ModDate>%<pdf:ModDate>XXX</pdf:ModDate>%g;
+- s%<xap:CreateDate>[^<]*</xap:CreateDate>%<xap:CreateDate>XXX</xap:CreateDate>%g;
+- s%<xap:ModifyDate>[^<]*</xap:ModifyDate>%<xap:ModifyDate>XXX</xap:ModifyDate>%g;
+- s%<xap:MetadataDate>[^<]*</xap:MetadataDate>%<xap:MetadataDate>XXX</xap:MetadataDate>%g;
+- }' "$f"
+- done
+- ;;
+- esac
+-
+- ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'`
+- case $ftype in
+- PE32\ executable*Mono\/\.Net\ assembly*)
+- echo "PE32 Mono/.Net assembly: $file"
+- if [ -x /usr/bin/monodis ] ; then
+- monodis old/$file 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file1}
+- monodis new/$file 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file2}
+- if ! cmp -s ${file1} ${file2}; then
+- echo "$file differs ($ftype)"
+- diff -u ${file1} ${file2}
+- return 1
+- fi
+- else
+- echo "Cannot compare, no monodis installed"
+- return 1
+- fi
+- ;;
+- ELF*executable*|ELF*[LM]SB\ shared\ object*)
+- objdump -d --no-show-raw-insn old/$file | filter_disasm > $file1
+- if ! test -s $file1; then
+- # objdump has no idea how to handle it
+- if ! diff_two_files; then
+- ret=1
+- break
+- fi
+- fi
+- elfdiff=
+- sed -i -e "s,old/,," $file1
+- objdump -d --no-show-raw-insn new/$file | filter_disasm > $file2
+- sed -i -e "s,new/,," $file2
+- if ! diff -u $file1 $file2 > $dfile; then
+- echo "$file differs in assembler output"
+- head -n 200 $dfile
+- elfdiff="1"
+- fi
+- echo "" >$file1
+- echo "" >$file2
+- # Don't compare .build-id and .gnu_debuglink sections
+- sections="$(objdump -s new/$file | grep "Contents of section .*:" | sed -r "s,.* (.*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" | tr "\n" " ")"
+- for section in $sections; do
+- objdump -s -j $section old/$file | sed "s,^old/,," > $file1
+- objdump -s -j $section new/$file | sed "s,^new/,," > $file2
+- if ! diff -u $file1 $file2 > $dfile; then
+- echo "$file differs in ELF section $section"
+- head -n 200 $dfile
+- elfdiff="1"
+- fi
+- done
+- if test -z "$elfdiff"; then
+- echo "$file: only difference was in build-id or gnu_debuglink, GOOD."
+- return 0
+- fi
+- return 1
+- ;;
+- *ASCII*|*text*)
+- if ! cmp -s old/$file new/$file; then
+- echo "$file differs ($ftype)"
+- diff -u old/$file new/$file | head -n 200
+- return 1
+- fi
+- ;;
+- directory|setuid,\ directory|sticky,\ directory)
+- # tar might package directories - ignore them here
+- return 0
+- ;;
+- bzip2\ compressed\ data*)
+- if ! check_compressed_file "$file" "bz2"; then
+- return 1
+- fi
+- ;;
+- gzip\ compressed\ data*)
+- if ! check_compressed_file "$file" "gzip"; then
+- return 1
+- fi
+- ;;
+- XZ\ compressed\ data*)
+- if ! check_compressed_file "$file" "xz"; then
+- return 1
+- fi
+- ;;
+- POSIX\ tar\ archive)
+- mv old/$file{,.tar}
+- mv new/$file{,.tar}
+- if ! check_single_file ${file}.tar; then
+- return 1
+- fi
+- ;;
+- cpio\ archive)
+- mv old/$file{,.cpio}
+- mv new/$file{,.cpio}
+- if ! check_single_file ${file}.cpio; then
+- return 1
+- fi
+- ;;
+- symbolic\ link\ to\ *)
+- readlink "old/$file" > $file1
+- readlink "new/$file" > $file2
+- if ! diff -u $file1 $file2; then
+- echo "symlink target for $file differs"
+- return 1
+- fi
+- ;;
+- *)
+- if ! diff_two_files; then
+- return 1
+- fi
+- ;;
+- esac
+- return 0
+-}
+-
+-# We need /proc mounted for some tests, so check that it's mounted and
+-# complain if not.
+-PROC_MOUNTED=0
+-if [ ! -d /proc/self/ ]; then
+- echo "/proc is not mounted"
+- mount -orw -n -tproc none /proc
+- PROC_MOUNTED=1
+-fi
+-
+-# preserve cmp_spec result for check_all runs
+-ret=$RES
+-for file in $files; do
+- if ! check_single_file $file; then
+- ret=1
+- if test -z "$check_all"; then
+- break
+- fi
+- fi
+-done
+-
+-if [ "$PROC_MOUNTED" -eq "1" ]; then
+- echo "Unmounting proc"
+- umount /proc
+-fi
+-
+-rm $file1 $file2 $dfile $rename_script
+-rm -rf $dir
+-if test "$ret" = 0; then
+- echo "Package content is identical"
+-fi
+-exit $ret
+-# vim: tw=666 ts=2 et
+diff --git a/same-build-result.sh b/same-build-result.sh
+index c8907e2..7e9bd4f 100644
+--- a/same-build-result.sh
++++ b/same-build-result.sh
+@@ -7,11 +7,11 @@
+ # Enhanced by Andreas Jaeger <aj@suse.de>
+ #
+ # The script decides if the new build differes from the former one,
+-# using rpm-check.sh.
++# using pkg-diff.sh.
+ # The script is called as part of the build process as:
+ # /usr/lib/build/same-build-result.sh /.build.oldpackages /usr/src/packages/RPMS /usr/src/packages/SRPMS
+
+-CMPSCRIPT=${0%/*}/rpm-check.sh
++CMPSCRIPT=${0%/*}/pkg-diff.sh
+ SCMPSCRIPT=${0%/*}/srpm-check.sh
+
+ check_all=1
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache.inc b/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache.inc
new file mode 100644
index 000000000..69aa64e5e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache.inc
@@ -0,0 +1,18 @@
+SUMMARY = "a fast C/C++ compiler cache"
+DESCRIPTION = "ccache is a compiler cache. It speeds up recompilation \
+by caching the result of previous compilations and detecting when the \
+same compilation is being done again. Supported languages are C, C\+\+, \
+Objective-C and Objective-C++."
+HOMEPAGE = "http://ccache.samba.org"
+SECTION = "devel"
+LICENSE = "GPLv3+"
+
+DEPENDS = "zlib"
+
+SRC_URI = "git://git.samba.org/ccache.git"
+
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.2.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.2.4.bb
new file mode 100644
index 000000000..fd45e4160
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ccache/ccache_3.2.4.bb
@@ -0,0 +1,10 @@
+require ccache.inc
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b3c337e7664559a789d9f7a93e5283c1"
+
+SRCREV = "2254797f1c5cfb83c4272da7b138f7f47218eb7d"
+
+SRC_URI += " \
+ file://0002-dev.mk.in-fix-file-name-too-long.patch \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ccache/files/0002-dev.mk.in-fix-file-name-too-long.patch b/import-layers/yocto-poky/meta/recipes-devtools/ccache/files/0002-dev.mk.in-fix-file-name-too-long.patch
new file mode 100644
index 000000000..837cfadf6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ccache/files/0002-dev.mk.in-fix-file-name-too-long.patch
@@ -0,0 +1,32 @@
+From 71bd0082c6edcf73f054a8a4fa34bd8dd4de7cd7 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 16 Sep 2015 19:45:40 -0700
+Subject: [PATCH] dev.mk.in: fix file name too long
+
+The all_cppflags change paths to filename which cause file name too long
+error when the path is longer than NAME_MAX (usually 255). Strip srcdir
+to fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ dev.mk.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dev.mk.in b/dev.mk.in
+index 1261ad3..ec55ac4 100644
+--- a/dev.mk.in
++++ b/dev.mk.in
+@@ -1,7 +1,7 @@
+ # GNU make syntax reigns in this file.
+
+ all_cflags += -Werror
+-all_cppflags += -MD -MP -MF .deps/$(subst .._,,$(subst /,_,$<)).d
++all_cppflags += -MD -MP -MF .deps/$(subst .._,,$(subst /,_,$(subst $(srcdir)/,,$<))).d
+
+ ASCIIDOC = asciidoc
+ GPERF = gperf
+--
+1.7.9.5
+
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
new file mode 100644
index 000000000..ff4d5ac44
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb
@@ -0,0 +1,26 @@
+# cdrtools-native OE build file
+# Copyright (C) 2004-2006, Advanced Micro Devices, Inc. All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+SUMMARY = "A set of tools for CD recording, including cdrecord"
+HOMEPAGE = "http://sourceforge.net/projects/cdrtools/"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & CDDL-1.0 & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=32f68170be424c2cd64804337726b312"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/cdrtools/cdrtools-${REALPV}.tar.bz2"
+
+SRC_URI[md5sum] = "7d45c5b7e1f78d85d1583b361aee6e8b"
+SRC_URI[sha256sum] = "ed282eb6276c4154ce6a0b5dee0bdb81940d0cbbfc7d03f769c4735ef5f5860f"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+inherit native
+
+PV = "3.01a31+really3.01"
+REALPV = "3.01"
+
+S = "${WORKDIR}/${BPN}-${REALPV}"
+
+do_install() {
+ make install GMAKE_NOWARN=true INS_BASE=${prefix} DESTDIR=${D}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch b/import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch
new file mode 100644
index 000000000..f96f104fa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Pending
+
+autoconf/automake set docdir automatically, use their value ensuring
+doc files are placed into $datadir/doc, not $prefix/doc.
+
+RP 5/7/2011
+
+Index: chrpath-0.13/Makefile.am
+===================================================================
+--- chrpath-0.13.orig/Makefile.am 2011-07-05 23:40:14.769920254 +0100
++++ chrpath-0.13/Makefile.am 2011-07-05 23:40:19.819920635 +0100
+@@ -1,7 +1,5 @@
+ SUBDIRS = testsuite deb
+
+-docdir = $(prefix)/doc/$(PACKAGE)-$(VERSION)
+-
+ doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README
+
+ bin_PROGRAMS = chrpath
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
new file mode 100644
index 000000000..e115eb5c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/chrpath/chrpath_0.16.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Tool to edit rpath in ELF binaries"
+DESCRIPTION = "chrpath allows you to change the rpath (where the \
+application looks for libraries) in an application. It does not \
+(yet) allow you to add an rpath if there isn't one already."
+HOMEPAGE = "http://alioth.debian.org/projects/chrpath/"
+BUGTRACKER = "http://alioth.debian.org/tracker/?atid=412807&group_id=31052"
+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 \
+ file://standarddoc.patch"
+
+SRC_URI[md5sum] = "2bf8d1d1ee345fc8a7915576f5649982"
+SRC_URI[sha256sum] = "bb0d4c54bac2990e1bdf8132f2c9477ae752859d523e141e72b3b11a12c26e7b"
+
+UPSTREAM_CHECK_URI = "http://alioth.debian.org/frs/?group_id=31052"
+
+inherit autotools
+
+# We don't have a staged chrpath-native for ensuring our binary is
+# relocatable, so use the one we've just built
+CHRPATH_BIN_class-native = "${B}/chrpath"
+
+PROVIDES_append_class-native = " chrpath-replacement-native"
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.4.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.4.3.bb
new file mode 100644
index 000000000..cb4e749d7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.4.3.bb
@@ -0,0 +1,16 @@
+require cmake.inc
+inherit native
+
+# Using cmake's internal libarchive, so some dependencies are needed
+DEPENDS += "bzip2-native zlib-native"
+
+SRC_URI += "\
+ file://cmlibarchive-disable-ext2fs.patch \
+"
+
+# Disable ccmake since we don't depend on ncurses
+CMAKE_EXTRACONF = "\
+ -DBUILD_CursesDialog=0 \
+ -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \
+ -DHAVE_SYS_ACL_H=0 \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake.inc b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake.inc
new file mode 100644
index 000000000..968d003b2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake.inc
@@ -0,0 +1,55 @@
+# Copyright (C) 2005, Koninklijke Philips Electronics NV. All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+SUMMARY = "Cross-platform, open-source make system"
+HOMEPAGE = "http://www.cmake.org/"
+BUGTRACKER = "http://public.kitware.com/Bug/my_view_page.php"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://Copyright.txt;md5=3ba5a6c34481652ce573e5c4e1d707e4 \
+ file://Source/cmake.h;beginline=1;endline=10;md5=341736dae83c9e344b53eeb1bc7d7bc2"
+
+CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV',1).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://0001-Add-NIOS2-CPU-support.patch \
+ "
+
+SRC_URI[md5sum] = "4cb3ff35b2472aae70f542116d616e63"
+SRC_URI[sha256sum] = "b73f8c1029611df7ed81796bf5ca8ba0ef41c6761132340c73ffe42704f980fa"
+
+UPSTREAM_CHECK_REGEX = "cmake-(?P<pver>\d+(\.\d+)+)\.tar"
+
+inherit autotools
+
+# Ugly hack to work around undefined OE_QMAKE_PATH_EXTERNAL_HOST_BINS variable
+# and possibly missing qmake binary (qtbase-native can be removed from sysroot
+# e.g. in order to upgrade it, even when there is target qtbase)
+
+# Fixes errors like this in cmake(-native).do_configure:
+#| -- Performing Test run_pic_test - Success
+#| CMake Error at tmp-eglibc/sysroots/qemuarm/usr/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:27 (message):
+#| The imported target "Qt5::Core" references the file
+#|
+#| "/qmake"
+#|
+#| but this file does not exist. Possible reasons include:
+
+do_configure_prepend() {
+ sed -i 's/^find_package(Qt5Core QUIET)$/#find_package(Qt5Core QUIET)/g' ${S}/Tests/RunCMake/CMakeLists.txt
+ sed -i 's/^ find_package(Qt5Core REQUIRED)/# find_package(Qt5Core REQUIRED)/g' ${S}/Tests/Qt4And5Automoc/CMakeLists.txt
+ sed -i 's/^ find_package(Qt5Widgets QUIET NO_MODULE)/# find_package(Qt5Widgets QUIET NO_MODULE)/g' ${S}/Tests/CMakeLists.txt
+ sed -i 's/^find_package(Qt5Widgets QUIET)/#find_package(Qt5Widgets QUIET)/g' ${S}/Source/QtDialog/CMakeLists.txt
+ sed -i 's/^ find_package(Qt5Widgets REQUIRED)/# find_package(Qt5Widgets REQUIRED)/g' ${S}/Tests/QtAutoUicInterface/CMakeLists.txt
+ sed -i 's/^ find_package(Qt5Widgets REQUIRED)/# find_package(Qt5Widgets REQUIRED)/g' ${S}/Tests/QtAutogen/CMakeLists.txt
+ sed -i 's/^ find_package(Qt5Core REQUIRED)/# find_package(Qt5Core REQUIRED)/g' ${S}/Tests/QtAutogen/autorcc_depends/CMakeLists.txt
+}
+
+# Extra flags to pass to cmake invoked by bootstrap
+CMAKE_EXTRACONF = ""
+
+do_configure () {
+ ${S}/configure --prefix=${prefix} -- ${CMAKE_EXTRACONF}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/0001-Add-NIOS2-CPU-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/0001-Add-NIOS2-CPU-support.patch
new file mode 100644
index 000000000..6e0ab9fb7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/0001-Add-NIOS2-CPU-support.patch
@@ -0,0 +1,50 @@
+From 3f8c3d3011ea192da2c761560b615f55763715ef Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Thu, 26 Nov 2015 21:31:04 +0100
+Subject: [PATCH] Add NIOS2 CPU support
+
+Add necessary bits to support the NIOS2 little-endian CPU.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Cc: Ley Foon Tan <lftan@altera.com>
+Cc: Thomas Chou <thomas@wytron.com.tw>
+Cc: Walter Goossens <waltergoossens@home.nl>
+Upstream-Status: Submitted
+---
+ Source/kwsys/CPU.h.in | 4 ++++
+ Utilities/KWIML/ABI.h.in | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/Source/kwsys/CPU.h.in b/Source/kwsys/CPU.h.in
+index 884d71a..66ffbb1 100644
+--- a/Source/kwsys/CPU.h.in
++++ b/Source/kwsys/CPU.h.in
+@@ -88,6 +88,10 @@
+ #elif defined(__mips) || defined(__mips__) || defined(__MIPS__)
+ # define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
+
++/* NIOS2 */
++#elif defined(__NIOS2__) || defined(__NIOS2) || defined(__nios2__)
++# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
++
+ /* OpenRISC 1000 */
+ #elif defined(__or1k__)
+ # define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
+diff --git a/Utilities/KWIML/ABI.h.in b/Utilities/KWIML/ABI.h.in
+index 6300ada..87b6e96 100644
+--- a/Utilities/KWIML/ABI.h.in
++++ b/Utilities/KWIML/ABI.h.in
+@@ -398,6 +398,10 @@ suppression macro @KWIML@_ABI_NO_VERIFY was defined.
+ #elif defined(__mips) || defined(__mips__) || defined(__MIPS__)
+ # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
+
++/* NIOS2 */
++#elif defined(__NIOS2__) || defined(__NIOS2) || defined(__nios2__)
++# define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
++
+ /* OpenRISC 1000 */
+ #elif defined(__or1k__)
+ # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
new file mode 100644
index 000000000..60014bbf2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
@@ -0,0 +1,18 @@
+set( CMAKE_SYSTEM_NAME Linux )
+set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE )
+set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE )
+set( CMAKE ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE )
+set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE )
+set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT} )
+set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
+set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
+
+string(REGEX MATCH "sysroots/([a-zA-Z0-9]+)" CMAKE_SYSTEM_PROCESSOR $ENV{SDKTARGETSYSROOT})
+string(REGEX REPLACE "sysroots/" "" CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
+
+# Include the toolchain configuration subscripts
+file( GLOB toolchain_config_files "${CMAKE_TOOLCHAIN_FILE}.d/*.cmake" )
+foreach(config ${toolchain_config_files})
+ include(${config})
+endforeach()
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch
new file mode 100644
index 000000000..bf3671259
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch
@@ -0,0 +1,26 @@
+Disable use of ext2fs/ext2_fs.h by cmake's internal libarchive copy
+
+We don't want to add a dependency on e2fsprogs-native for cmake-native,
+and we don't use CPack so just disable this functionality.
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+--- a/Utilities/cmlibarchive/CMakeLists.txt
++++ b/Utilities/cmlibarchive/CMakeLists.txt
+@@ -237,12 +237,8 @@ LA_CHECK_INCLUDE_FILE("copyfile.h" HAVE_COPYFILE_H)
+ LA_CHECK_INCLUDE_FILE("direct.h" HAVE_DIRECT_H)
+ LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
+ LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H)
+-LA_CHECK_INCLUDE_FILE("ext2fs/ext2_fs.h" HAVE_EXT2FS_EXT2_FS_H)
+-
+-CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h>
+-#include <ext2fs/ext2_fs.h>
+-int main(void) { return EXT2_IOC_GETFLAGS; }" HAVE_WORKING_EXT2_IOC_GETFLAGS)
+-
++SET(HAVE_EXT2FS_EXT2_FS_H 0)
++SET(HAVE_WORKING_EXT2_IOC_GETFLAGS 0)
+ LA_CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H)
+ LA_CHECK_INCLUDE_FILE("grp.h" HAVE_GRP_H)
+ LA_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh
new file mode 100644
index 000000000..0eb56b66f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh
@@ -0,0 +1 @@
+alias cmake="cmake -DCMAKE_TOOLCHAIN_FILE=$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch
new file mode 100644
index 000000000..80fc277fa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch
@@ -0,0 +1,77 @@
+Fail silently if system Qt installation is broken
+
+Fixes a regression in behaviour from 2.8.10 to 2.8.11 resulting in the
+following error if the system Qt installation is broken:
+
+CMake Error at Modules/FindQt4.cmake:1028 (set_property):
+ set_property could not find TARGET Qt4::QtCore. Perhaps it has not yet
+ been created.
+Call Stack (most recent call first):
+ Tests/RunCMake/CMakeLists.txt:79 (find_package)
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+The patch was slightly adapted in order to match cmake 3.2.2:
+Another set_property was introduced which had to be included
+within the if(QT_QTCORE_FOUND) statement.
+
+Signed-off-by: Moritz Blume <moritz.blume@bmw-carit.de>
+---
+ Modules/FindQt4.cmake | 39 ++++++++++++++++++++-------------------
+ 1 file changed, 20 insertions(+), 19 deletions(-)
+
+diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
+index 6704769..9048e35 100644
+--- a/Modules/FindQt4.cmake
++++ b/Modules/FindQt4.cmake
+@@ -1000,25 +1000,26 @@ if (QT_QMAKE_EXECUTABLE AND
+ endif()
+ endmacro()
+
+-
+- # Set QT_xyz_LIBRARY variable and add
+- # library include path to QT_INCLUDES
+- _QT4_ADJUST_LIB_VARS(QtCore)
+- set_property(TARGET Qt4::QtCore APPEND PROPERTY
+- INTERFACE_INCLUDE_DIRECTORIES
+- "${QT_MKSPECS_DIR}/default"
+- ${QT_INCLUDE_DIR}
+- )
+- set_property(TARGET Qt4::QtCore APPEND PROPERTY
+- INTERFACE_COMPILE_DEFINITIONS
+- $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>
+- )
+- set_property(TARGET Qt4::QtCore PROPERTY
+- INTERFACE_QT_MAJOR_VERSION 4
+- )
+- set_property(TARGET Qt4::QtCore APPEND PROPERTY
+- COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION
+- )
++ if(QT_QTCORE_FOUND)
++ # Set QT_xyz_LIBRARY variable and add
++ # library include path to QT_INCLUDES
++ _QT4_ADJUST_LIB_VARS(QtCore)
++ set_property(TARGET Qt4::QtCore APPEND PROPERTY
++ INTERFACE_INCLUDE_DIRECTORIES
++ "${QT_MKSPECS_DIR}/default"
++ ${QT_INCLUDE_DIR}
++ )
++ set_property(TARGET Qt4::QtCore APPEND PROPERTY
++ INTERFACE_COMPILE_DEFINITIONS
++ $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>
++ )
++ set_property(TARGET Qt4::QtCore PROPERTY
++ INTERFACE_QT_MAJOR_VERSION 4
++ )
++ set_property(TARGET Qt4::QtCore APPEND PROPERTY
++ COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION
++ )
++ endif()
+
+ foreach(QT_MODULE ${QT_MODULES})
+ _QT4_ADJUST_LIB_VARS(${QT_MODULE})
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch
new file mode 100644
index 000000000..15cbca89d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch
@@ -0,0 +1,54 @@
+cmake: support OpenEmbedded Qt4 tool binary names
+
+The FindQt4 module looks for Qt4 binaries to be able to gather the
+paths used for compilation and also to be using during other processes
+(translation update, translation binary generating and like) however
+OpenEmbedded has renamed those to allow old QMake to be used in
+parallel with the current one. This patch adds support for the
+OpenEmbedded specific binary names.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+The patch was slightly adapted in order to match cmake 3.2.2:
+Instead of find_program, _find_qt4_program is now used.
+
+Signed-off-by: Moritz Blume <moritz.blume@bmw-carit.de>
+---
+ Modules/FindQt4.cmake | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
+index 11091b5..6704769 100644
+--- a/Modules/FindQt4.cmake
++++ b/Modules/FindQt4.cmake
+@@ -522,7 +522,7 @@ endfunction()
+
+ set(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
+
+-set(_QT4_QMAKE_NAMES qmake qmake4 qmake-qt4 qmake-mac)
++set(_QT4_QMAKE_NAMES qmake qmake2 qmake4 qmake-qt4 qmake-mac)
+ _qt4_find_qmake("${_QT4_QMAKE_NAMES}" QT_QMAKE_EXECUTABLE QTVERSION)
+
+ if (QT_QMAKE_EXECUTABLE AND
+@@ -1148,12 +1148,12 @@ if (QT_QMAKE_EXECUTABLE AND
+ _find_qt4_program(QT_MOC_EXECUTABLE Qt4::moc moc-qt4 moc4 moc)
+ _find_qt4_program(QT_UIC_EXECUTABLE Qt4::uic uic-qt4 uic4 uic)
+ _find_qt4_program(QT_UIC3_EXECUTABLE Qt4::uic3 uic3)
+- _find_qt4_program(QT_RCC_EXECUTABLE Qt4::rcc rcc)
+- _find_qt4_program(QT_DBUSCPP2XML_EXECUTABLE Qt4::qdbuscpp2xml qdbuscpp2xml)
+- _find_qt4_program(QT_DBUSXML2CPP_EXECUTABLE Qt4::qdbusxml2cpp qdbusxml2cpp)
++ _find_qt4_program(QT_RCC_EXECUTABLE Qt4::rcc rcc4 rcc)
++ _find_qt4_program(QT_DBUSCPP2XML_EXECUTABLE Qt4::qdbuscpp2xml qdbuscpp2xml4 qdbuscpp2xml)
++ _find_qt4_program(QT_DBUSXML2CPP_EXECUTABLE Qt4::qdbusxml2cpp qdbusxml2cpp4 qdbusxml2cpp)
+ _find_qt4_program(QT_LUPDATE_EXECUTABLE Qt4::lupdate lupdate-qt4 lupdate4 lupdate)
+ _find_qt4_program(QT_LRELEASE_EXECUTABLE Qt4::lrelease lrelease-qt4 lrelease4 lrelease)
+- _find_qt4_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE Qt4::qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator)
++ _find_qt4_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE Qt4::qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator qcollectiongenerator4)
+ _find_qt4_program(QT_DESIGNER_EXECUTABLE Qt4::designer designer-qt4 designer4 designer)
+ _find_qt4_program(QT_LINGUIST_EXECUTABLE Qt4::linguist linguist-qt4 linguist4 linguist)
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.4.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.4.3.bb
new file mode 100644
index 000000000..2f188f071
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/cmake/cmake_3.4.3.bb
@@ -0,0 +1,53 @@
+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):
+ raise bb.build.FuncFailed('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_LIBRARY_BZIP2=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_CURL=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_EXPAT=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_FORM=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_LIBLZMA=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_ZLIB=1 \
+ -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/desktop-file-utils/desktop-file-utils-native_0.22.bb b/import-layers/yocto-poky/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.22.bb
new file mode 100644
index 000000000..f899cd2f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.22.bb
@@ -0,0 +1,18 @@
+SECTION = "console/utils"
+SUMMARY = "Command line utilities for working with *.desktop files"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/desktop-file-utils"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+DEPENDS = "glib-2.0-native"
+
+SRC_URI = "http://freedesktop.org/software/desktop-file-utils/releases/desktop-file-utils-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "c6b9f9aac1ea143091178c23437e6cd0"
+SRC_URI[sha256sum] = "843532672692f98e9b2d6ae6cc8658da562dfde1606c7f33d9d227a344de56c5"
+
+inherit autotools native
+
+S = "${WORKDIR}/desktop-file-utils-${PV}"
+
+EXTRA_OECONF += "ac_cv_prog_EMACS=no"
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
new file mode 100644
index 000000000..cb7830b99
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config.bb
@@ -0,0 +1,23 @@
+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"
+
+SRC_URI = "file://distcc.sh"
+
+S = "${WORKDIR}"
+
+# Default to the host machine for a running qemu session
+DISTCC_HOSTS ?= "192.168.7.1"
+
+do_configure() {
+ sed -i "s%@DISTCC_HOSTS@%${DISTCC_HOSTS}%" distcc.sh
+}
+
+do_install() {
+ install -d ${D}${sysconfdir}/profile.d
+ install -m 0755 distcc.sh ${D}${sysconfdir}/profile.d/
+}
+
+RDEPENDS_${PN} = "distcc"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config/distcc.sh b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config/distcc.sh
new file mode 100644
index 000000000..b4205931d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/distcc-config/distcc.sh
@@ -0,0 +1,4 @@
+DISTCC_HOSTS="@DISTCC_HOSTS@"
+#DISTCC_VERBOSE="1"
+
+export DISTCC_HOSTS
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
new file mode 100644
index 000000000..169d00581
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root.bb
@@ -0,0 +1,18 @@
+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"
+
+PR = "r1"
+
+SRC_URI = "file://exports"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${sysconfdir}
+ install -m 0644 exports ${D}${sysconfdir}/
+}
+
+RDEPENDS_${PN} = "packagegroup-core-nfs-server"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root/exports b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root/exports
new file mode 100644
index 000000000..1353c5ad8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/devel-config/nfs-export-root/exports
@@ -0,0 +1 @@
+/ *(rw,no_root_squash,async,no_subtree_check)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat/run-ptest
new file mode 100644
index 000000000..a936b3d3f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+./testing/run_test.sh ./testing/case*.pat |sed \
+ -e 's|** ok|PASS|' \
+ -e 's|?? fail|FAIL|'
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
new file mode 100644
index 000000000..0ec41c3ab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Tool to produce a statistics based on a diff"
+DESCRIPTION = "diffstat reads the output of diff and displays a histogram of \
+the insertions, deletions, and modifications per-file. It is useful for \
+reviewing large, complex patch files."
+HOMEPAGE = "http://invisible-island.net/diffstat/"
+SECTION = "devel"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://install-sh;endline=42;md5=b3549726c1022bee09c174c72a0ca4a5"
+
+SRC_URI = "ftp://invisible-island.net/diffstat/diffstat-${PV}.tgz \
+ file://run-ptest \
+"
+
+SRC_URI[md5sum] = "c048a32d55d8bd6724f382baf41f325f"
+SRC_URI[sha256sum] = "25359e0c27183f997b36c9202583b5dc2df390c20e22a92606af4bf7856a55ee"
+
+S = "${WORKDIR}/diffstat-${PV}"
+
+inherit autotools gettext ptest
+
+LDFLAGS += "${TOOLCHAIN_OPTIONS}"
+
+do_configure () {
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ mv ${S}/aclocal.m4 ${S}/acinclude.m4
+ fi
+ autotools_do_configure
+}
+
+do_install_ptest() {
+ cp -r ${S}/testing ${D}${PTEST_PATH}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/distcc/distcc_3.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/distcc/distcc_3.1.bb
new file mode 100644
index 000000000..f8879c87c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/distcc/distcc_3.1.bb
@@ -0,0 +1,74 @@
+SUMMARY = "A parallel build system"
+DESCRIPTION = "distcc is a parallel build system that distributes \
+compilation of C/C++/ObjC code across machines on a network."
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "avahi"
+
+GTKCONFIG = "gtk"
+GTKCONFIG_libc-uclibc = ""
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${GTKCONFIG}', '', d)} popt"
+PACKAGECONFIG[gtk] = "--with-gtk,--without-gtk --without-gnome,gtk+"
+# use system popt by default
+PACKAGECONFIG[popt] = "--without-included-popt,--with-included-popt,popt"
+
+RRECOMMENDS_${PN} = "avahi-daemon"
+
+SRC_URI = "git://github.com/distcc/distcc.git \
+ file://separatebuilddir.patch \
+ file://0001-zeroconf-Include-fcntl.h.patch \
+ file://default \
+ file://distccmon-gnome.desktop \
+ file://distcc \
+ file://distcc.service"
+SRCREV = "9a172d3d20042754a30c0cd9a5d63fd1a8120c31"
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig update-rc.d useradd systemd
+
+EXTRA_OECONF += "--disable-Werror PYTHON=/dev/null"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system \
+ --home /dev/null \
+ --no-create-home \
+ --gid nogroup \
+ distcc"
+
+INITSCRIPT_NAME = "distcc"
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "distcc.service"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d/
+ install -d ${D}${sysconfdir}/default
+ install -m 0755 ${WORKDIR}/distcc ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/distcc
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/distcc.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_unitdir}/system/distcc.service
+ ${DESKTOPINSTALL}
+}
+DESKTOPINSTALL = ""
+DESKTOPINSTALL_libc-glibc () {
+ install -d ${D}${datadir}/distcc/
+ install -m 0644 ${WORKDIR}/distccmon-gnome.desktop ${D}${datadir}/distcc/
+}
+PACKAGES += "distcc-distmon-gnome"
+
+FILES_${PN} = " ${sysconfdir} \
+ ${bindir}/distcc \
+ ${bindir}/lsdistcc \
+ ${bindir}/distccd \
+ ${bindir}/distccmon-text \
+ ${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/distcc/files/0001-zeroconf-Include-fcntl.h.patch b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/0001-zeroconf-Include-fcntl.h.patch
new file mode 100644
index 000000000..b17ec9c95
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/0001-zeroconf-Include-fcntl.h.patch
@@ -0,0 +1,29 @@
+From 8331fc4759d809512f404e7a27f817ad6d616450 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 18:00:33 -0700
+Subject: [PATCH] zeroconf: Include fcntl.h
+
+We need it for getting deinitions for O_* e.g. O_CREAT
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/zeroconf.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/zeroconf.c b/src/zeroconf.c
+index 414ddc4..31bd33f 100644
+--- a/src/zeroconf.c
++++ b/src/zeroconf.c
+@@ -33,6 +33,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <limits.h>
++#include <fcntl.h>
+
+ #include <avahi-common/domain.h>
+ #include <avahi-common/error.h>
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/default b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/default
new file mode 100644
index 000000000..63c4159b9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/default
@@ -0,0 +1,24 @@
+# Defaults for distcc initscript
+# sourced by /etc/init.d/distcc
+
+#
+# should distcc be started on boot?
+#
+# STARTDISTCC="true"
+
+STARTDISTCC="true"
+
+#
+# Which networks/hosts should be allowed to connect to the daemon?
+# You can list multiple hosts/networks separated by spaces.
+# Networks have to be in CIDR notation, f.e. 192.168.1.0/24
+# Hosts are represented by a single IP Adress
+#
+# ALLOWEDNETS="127.0.0.1"
+
+ALLOWEDNETS="192.168.7.0/24"
+
+#
+# OPTIONS is used for the systemd service file
+#
+OPTIONS="--allow 192.168.7.0/24"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc
new file mode 100755
index 000000000..e36f0fa69
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc
@@ -0,0 +1,119 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: distcc
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 1
+# Short-Description: simple distributed compiler client and server
+### END INIT INFO
+#
+# distccd Debian init.d script contributed by Jason Thomas. (Debian #161136)
+#
+# skeleton example file to build /etc/init.d/ scripts.
+# This file should be used to construct scripts for /etc/init.d.
+#
+# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
+# Modified for Debian GNU/Linux
+# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
+#
+# Version: @(#)skeleton 1.9.1 08-Apr-2002 miquels@cistron.nl
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/bin/distccd
+NAME=distcc
+DESC="Distributed Compiler Daemon"
+DAEMON_ARGS="--pid-file=/var/run/$NAME.pid --daemon"
+# please change those variables by overriding them in /etc/defaults/distcc
+ALLOWEDNETS="127.0.0.1"
+
+# Reads config file (will override defaults above)
+[ -r /etc/default/distcc ] && . /etc/default/distcc
+
+test -x $DAEMON || exit 0
+
+set -e
+
+# Source function library.
+. /etc/init.d/functions
+
+# construct access list
+ALLOW=""
+for net in $ALLOWEDNETS
+do
+ ALLOW="$ALLOW --allow $net"
+done
+
+should_start() {
+ if [ "$STARTDISTCC" != "true" ] && [ "$STARTDISTCC" != "YES" ]; then
+ echo "STARTDISTCC is set to false in /etc/default/distcc"
+ echo "$DAEMON not starting"
+ exit 0
+ fi
+ # we need permission to write to the pid file
+ touch /var/run/$NAME.pid
+ chown distcc /var/run/$NAME.pid
+}
+
+case "$1" in
+ start)
+ should_start
+ echo -n "Starting $DESC: $NAME"
+ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON -- $DAEMON_ARGS $ALLOW ||
+ {
+ code=$?
+ echo "$0: start failed with error code $code" >&2
+ exit $code
+ }
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: $NAME"
+ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON ||
+ {
+ code=$?
+ echo "$0: stop failed with error code $code" >&2
+ exit $code
+ }
+ rm -f /var/run/$NAME.pid >/dev/null 2>&1
+ echo "."
+ ;;
+ restart|force-reload)
+ #
+ # If the "reload" option is implemented, move the "force-reload"
+ # option to the "reload" entry above. If not, "force-reload" is
+ # just the same as "restart".
+ #
+ echo -n "Restarting $DESC: $NAME"
+ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON
+ sleep 1
+ should_start
+ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON -- $DAEMON_ARGS $ALLOW ||
+ {
+ code=$?
+ rm -f /var/run/$NAME.pid >/dev/null 2>&1
+ echo "$0: restart failed with error code $code" >&2
+ exit $code
+ }
+ echo "."
+ ;;
+
+ status)
+ status $DAEMON
+ exit $?
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc.service b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc.service
new file mode 100644
index 000000000..0253ddf52
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distcc.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Distccd A Distributed Compilation Server
+After=network.target
+
+[Service]
+User=distcc
+EnvironmentFile=-/etc/default/distcc
+ExecStart=@BINDIR@/distccd --verbose --no-detach --daemon $OPTIONS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop
new file mode 100644
index 000000000..7b5d85ce4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Version=0.9.4
+Exec=distccmon-gnome
+Name=distcc monitor
+GenericName=Distributed Compile Monitor
+Comment=Graphical view of distributed compile tasks
+Icon=distccmon-gnome-icon
+TryExec=distccmon-gnome
+Terminal=false
+Type=Application
+Categories=GNOME;Development;
+StartupNotify=true
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/separatebuilddir.patch b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/separatebuilddir.patch
new file mode 100644
index 000000000..b9e3e42dd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/distcc/files/separatebuilddir.patch
@@ -0,0 +1,21 @@
+When building with a separate build directory, make install fails,
+unable to find the gnome_data files. This patch corrects the
+patch and ensures the build works in this case.
+
+RP 2013/3/8
+
+Upstream-Status: Pending
+
+Index: distcc-3.1/Makefile.in
+===================================================================
+--- distcc-3.1.orig/Makefile.in 2008-12-02 21:50:31.000000000 +0000
++++ distcc-3.1/Makefile.in 2013-03-08 10:49:24.224400937 +0000
+@@ -1088,7 +1088,7 @@
+ install-gnome-data: $(gnome_data)
+ $(mkinstalldirs) "$(DESTDIR)$(pkgdatadir)"
+ for p in $(gnome_data); do \
+- $(INSTALL_DATA) "$$p" "$(DESTDIR)$(pkgdatadir)" || exit 1; \
++ $(INSTALL_DATA) "$(srcdir)/$$p" "$(DESTDIR)$(pkgdatadir)" || exit 1; \
+ done
+
+ install-conf: $(conf_files) $(default_files)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dmidecode/dmidecode_3.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/dmidecode/dmidecode_3.0.bb
new file mode 100644
index 000000000..109a9d2ee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dmidecode/dmidecode_3.0.bb
@@ -0,0 +1,23 @@
+SUMMARY = "DMI (Desktop Management Interface) table related utilities"
+HOMEPAGE = "http://www.nongnu.org/dmidecode/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/dmidecode/${BP}.tar.xz"
+
+COMPATIBLE_HOST = "(i.86|x86_64|aarch64|arm|powerpc|powerpc64).*-linux"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_install() {
+ oe_runmake DESTDIR="${D}" install
+}
+
+do_unpack_extra() {
+ sed -i -e '/^prefix/s:/usr/local:${exec_prefix}:' ${S}/Makefile
+}
+addtask unpack_extra after do_unpack before do_patch
+
+SRC_URI[md5sum] = "281ee572d45c78eca73a14834c495ffd"
+SRC_URI[sha256sum] = "7ec35bb193729c1d593a1460b59d82d24b89102ab23fd0416e6cf4325d077e45"
+
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
new file mode 100644
index 000000000..b7791f360
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb
@@ -0,0 +1,71 @@
+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
new file mode 100644
index 000000000..a3ee5d83a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-3.1-native_3.1.bb
@@ -0,0 +1,26 @@
+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
new file mode 100644
index 000000000..be5968077
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.1-native_4.1.bb
@@ -0,0 +1,26 @@
+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
new file mode 100644
index 000000000..ae723c74f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.5-native.bb
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 000000000..af5098796
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc
@@ -0,0 +1,70 @@
+# 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
new file mode 100644
index 000000000..6da7f5b8c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-sgml-dtd/files/LICENSE-OASIS
@@ -0,0 +1,16 @@
+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
new file mode 100644
index 000000000..db079d68f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-0.6.14/re.patch
@@ -0,0 +1,29 @@
+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
new file mode 100644
index 000000000..c3a5f3b42
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb
@@ -0,0 +1,63 @@
+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 = "\
+ ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES/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/LICENSE-OASIS b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/LICENSE-OASIS
new file mode 100644
index 000000000..6da7f5b8c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/LICENSE-OASIS
@@ -0,0 +1,16 @@
+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-xml/docbook-xml-dtd4/docbook-xml-update-catalog.xml.patch b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml-update-catalog.xml.patch
new file mode 100644
index 000000000..59703609c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml-update-catalog.xml.patch
@@ -0,0 +1,515 @@
+docbook-xml: update catalog.xml
+
+Refer Ubuntu 13.04 to update catalog.xml
+
+Upstream-Status: Pending
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ docbook-4.0/catalog.xml | 72 +++++++++++++++++++++++++++++++++++++++++++++++
+ docbook-4.1.2/catalog.xml | 66 +++++++++++++++++++++++++++++++++++++++++++
+ docbook-4.2/catalog.xml | 69 ++++++---------------------------------------
+ docbook-4.3/catalog.xml | 72 ++++++++---------------------------------------
+ docbook-4.4/catalog.xml | 63 ++---------------------------------------
+ docbook-4.5/catalog.xml | 63 ++---------------------------------------
+ 6 files changed, 165 insertions(+), 240 deletions(-)
+ create mode 100644 docbook-4.0/catalog.xml
+ create mode 100644 docbook-4.1.2/catalog.xml
+
+diff --git a/docbook-4.0/catalog.xml b/docbook-4.0/catalog.xml
+new file mode 100644
+--- /dev/null
++++ b/docbook-4.0/catalog.xml
+@@ -0,0 +1,72 @@
++<?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++ "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
++<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
++
++<!-- ...................................................................... -->
++<!-- XML Catalog data for DocBook XML V4.0............................... -->
++<!-- File catalog.xml ..................................................... -->
++
++<!-- 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/.
++ -->
++
++<!-- This is the catalog data file for DocBook V4.0. It is provided as
++ a convenience in building your own catalog files. You need not use
++ the filenames listed here, and need not use the filename method of
++ identifying storage objects at all. See the documentation for
++ detailed information on the files associated with the DocBook DTD.
++ See XML Catalogs at http://www.oasis-open.org/committees/entity/ for
++ detailed information on supplying and using catalog data.
++ -->
++
++<!-- ...................................................................... -->
++<!-- DocBook driver file .................................................. -->
++
++<public publicId="-//Norman Walsh//DTD DocBk XML V4.0//EN"
++ uri="docbookx.dtd"/>
++
++<!-- Other ways to refer to DocBook XML v4.0............................... -->
++<public publicId="-//Norman Walsh//DTD DocBook XML V4.0//EN"
++ uri="docbookx.dtd"/>
++
++<system systemId="http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
++<!-- ...................................................................... -->
++<!-- DocBook modules ...................................................... -->
++
++<public publicId="-//Norman Walsh//ENTITIES DocBook XML Notations V4.0//EN"
++ uri="dbnotnx.mod"/>
++
++<public publicId="-//Norman Walsh//ENTITIES DocBook XML Character Entities V4.0//EN"
++ uri="dbcentx.mod"/>
++
++<public publicId="-//Norman Walsh//ELEMENTS DocBook XML Information Pool V4.0//EN"
++ uri="dbpoolx.mod"/>
++
++<public publicId="-//Norman Walsh//ELEMENTS DocBook XML Document Hierarchy V4.0//EN"
++ uri="dbhierx.mod"/>
++
++<public publicId="-//Norman Walsh//ENTITIES DocBook XML Additional General Entities V4.0//EN"
++ uri="dbgenent.mod"/>
++
++<public publicId="-//Norman Walsh//DTD CALS Table Model XML V4.0//EN"
++ uri="calstblx.dtd"/>
++
++<!-- UNOFFICIAL conversion of the exchange table model to XML, based on the OASIS Exchange -->
++<!-- Table Model PUBLIC "-//SGML Open//DTD Exchange Table Model 19960430//EN" -->
++<public publicId="-//Normal Walsh//Exchange Table Model 19960430 XML V4.0//EN"
++ uri="soextblx.dtd"/>
++
++<!-- the following FPI is declared for the DTD inside the DTD, but we'll -->
++<!-- use the version from the latest DocBook
++<public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN"
++ uri="soextblx.dtd"/> -->
++
++<!-- End of catalog data for DocBook XML V4.0 ............................. -->
++<!-- ...................................................................... -->
++
++</catalog>
+diff --git a/docbook-4.1.2/catalog.xml b/docbook-4.1.2/catalog.xml
+new file mode 100644
+--- /dev/null
++++ b/docbook-4.1.2/catalog.xml
+@@ -0,0 +1,66 @@
++<?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++ "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
++<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
++
++<!-- ...................................................................... -->
++<!-- XML Catalog data for DocBook XML V4.1.2............................... -->
++<!-- File catalog.xml ..................................................... -->
++
++<!-- 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/.
++ -->
++
++<!-- This is the catalog data file for DocBook V4.1.2. It is provided as
++ a convenience in building your own catalog files. You need not use
++ the filenames listed here, and need not use the filename method of
++ identifying storage objects at all. See the documentation for
++ detailed information on the files associated with the DocBook DTD.
++ See XML Catalogs at http://www.oasis-open.org/committees/entity/ for
++ detailed information on supplying and using catalog data.
++ -->
++
++<!-- ...................................................................... -->
++<!-- DocBook driver file .................................................. -->
++
++<public publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
++ uri="docbookx.dtd"/>
++
++<system systemId="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
++<system systemId="http://docbook.org/xml/4.1.2/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
++<!-- ...................................................................... -->
++<!-- DocBook modules ...................................................... -->
++
++<public publicId="-//OASIS//DTD DocBook CALS Table Model V4.1.2//EN"
++ uri="calstblx.dtd"/>
++
++ <!-- already included in docbook 4.2
++<public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN"
++ uri="soextblx.dtd"/> -->
++
++<public publicId="-//OASIS//ELEMENTS DocBook XML Information Pool V4.1.2//EN"
++ uri="dbpoolx.mod"/>
++
++<public publicId="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.1.2//EN"
++ uri="dbhierx.mod"/>
++
++<public publicId="-//OASIS//ENTITIES DocBook Additional General Entities V4.1.2//EN"
++ uri="dbgenent.mod"/>
++
++<public publicId="-//OASIS//ENTITIES DocBook Notations V4.1.2//EN"
++ uri="dbnotnx.mod"/>
++
++<public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.1.2//EN"
++ uri="dbcentx.mod"/>
++
++
++<!-- End of catalog data for DocBook XML V4.1.2 ............................. -->
++<!-- ...................................................................... -->
++
++</catalog>
+diff --git a/docbook-4.2/catalog.xml b/docbook-4.2/catalog.xml
+--- a/docbook-4.2/catalog.xml
++++ b/docbook-4.2/catalog.xml
+@@ -1,4 +1,7 @@
+ <?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++ "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
+ <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+
+ <!-- ...................................................................... -->
+@@ -25,6 +28,12 @@
+ <public publicId="-//OASIS//DTD DocBook XML V4.2//EN"
+ uri="docbookx.dtd"/>
+
++<system systemId="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
++<system systemId="http://docbook.org/xml/4.2/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
+ <!-- ...................................................................... -->
+ <!-- DocBook modules ...................................................... -->
+
+@@ -49,66 +58,6 @@
+ <public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.2//EN"
+ uri="dbcentx.mod"/>
+
+-<!-- ...................................................................... -->
+-<!-- ISO entity sets ...................................................... -->
+-
+-<public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+- uri="ent/iso-dia.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+- uri="ent/iso-num.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
+- uri="ent/iso-pub.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
+- uri="ent/iso-tech.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+- uri="ent/iso-lat1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+- uri="ent/iso-lat2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+- uri="ent/iso-grk1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+- uri="ent/iso-grk2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+- uri="ent/iso-grk3.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+- uri="ent/iso-grk4.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+- uri="ent/iso-amsa.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+- uri="ent/iso-amsb.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+- uri="ent/iso-amsc.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+- uri="ent/iso-amsn.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+- uri="ent/iso-amso.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+- uri="ent/iso-amsr.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+- uri="ent/iso-box.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+- uri="ent/iso-cyr1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+- uri="ent/iso-cyr2.ent"/>
+-
+ <!-- End of catalog data for DocBook XML V4.2 ............................. -->
+ <!-- ...................................................................... -->
+
+diff --git a/docbook-4.3/catalog.xml b/docbook-4.3/catalog.xml
+--- a/docbook-4.3/catalog.xml
++++ b/docbook-4.3/catalog.xml
+@@ -1,4 +1,7 @@
+ <?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++ "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
+ <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+
+ <!-- ...................................................................... -->
+@@ -25,12 +28,21 @@
+ <public publicId="-//OASIS//DTD DocBook XML V4.3//EN"
+ uri="docbookx.dtd"/>
+
++<system systemId="http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
++<system systemId="http://docbook.org/xml/4.3/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
+ <!-- ...................................................................... -->
+ <!-- DocBook modules ...................................................... -->
+
+ <public publicId="-//OASIS//DTD DocBook CALS Table Model V4.3//EN"
+ uri="calstblx.dtd"/>
+
++<public publicId="-//OASIS//ELEMENTS DocBook XML HTML Tables V4.3//EN"
++ uri="htmltblx.mod"/>
++
+ <public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN"
+ uri="soextblx.dtd"/>
+
+@@ -49,66 +61,6 @@
+ <public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.3//EN"
+ uri="dbcentx.mod"/>
+
+-<!-- ...................................................................... -->
+-<!-- ISO entity sets ...................................................... -->
+-
+-<public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+- uri="ent/iso-dia.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+- uri="ent/iso-num.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
+- uri="ent/iso-pub.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
+- uri="ent/iso-tech.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+- uri="ent/iso-lat1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+- uri="ent/iso-lat2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+- uri="ent/iso-grk1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+- uri="ent/iso-grk2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+- uri="ent/iso-grk3.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+- uri="ent/iso-grk4.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+- uri="ent/iso-amsa.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+- uri="ent/iso-amsb.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+- uri="ent/iso-amsc.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+- uri="ent/iso-amsn.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+- uri="ent/iso-amso.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+- uri="ent/iso-amsr.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+- uri="ent/iso-box.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+- uri="ent/iso-cyr1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+- uri="ent/iso-cyr2.ent"/>
+-
+ <!-- End of catalog data for DocBook XML V4.3 ............................. -->
+ <!-- ...................................................................... -->
+
+diff --git a/docbook-4.4/catalog.xml b/docbook-4.4/catalog.xml
+--- a/docbook-4.4/catalog.xml
++++ b/docbook-4.4/catalog.xml
+@@ -1,4 +1,7 @@
+ <?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++ "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
+ <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
+
+ <!-- ...................................................................... -->
+@@ -58,66 +61,6 @@
+ <public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.4//EN"
+ uri="dbcentx.mod"/>
+
+-<!-- ...................................................................... -->
+-<!-- ISO entity sets ...................................................... -->
+-
+-<public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+- uri="ent/isodia.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+- uri="ent/isonum.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
+- uri="ent/isopub.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
+- uri="ent/isotech.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+- uri="ent/isolat1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+- uri="ent/isolat2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+- uri="ent/isogrk1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+- uri="ent/isogrk2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+- uri="ent/isogrk3.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+- uri="ent/isogrk4.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+- uri="ent/isoamsa.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+- uri="ent/isoamsb.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+- uri="ent/isoamsc.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+- uri="ent/isoamsn.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+- uri="ent/isoamso.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+- uri="ent/isoamsr.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+- uri="ent/isobox.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+- uri="ent/isocyr1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+- uri="ent/isocyr2.ent"/>
+-
+ <!-- End of catalog data for DocBook XML V4.4 ............................. -->
+ <!-- ...................................................................... -->
+
+diff --git a/docbook-4.5/catalog.xml b/docbook-4.5/catalog.xml
+--- a/docbook-4.5/catalog.xml
++++ b/docbook-4.5/catalog.xml
+@@ -1,4 +1,7 @@
+ <?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++ "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
+ <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
+
+ <!-- ...................................................................... -->
+@@ -58,66 +61,6 @@
+ <public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.5//EN"
+ uri="dbcentx.mod"/>
+
+-<!-- ...................................................................... -->
+-<!-- ISO entity sets ...................................................... -->
+-
+-<public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+- uri="ent/isodia.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+- uri="ent/isonum.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
+- uri="ent/isopub.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
+- uri="ent/isotech.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+- uri="ent/isolat1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+- uri="ent/isolat2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+- uri="ent/isogrk1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+- uri="ent/isogrk2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+- uri="ent/isogrk3.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+- uri="ent/isogrk4.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+- uri="ent/isoamsa.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+- uri="ent/isoamsb.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+- uri="ent/isoamsc.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+- uri="ent/isoamsn.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+- uri="ent/isoamso.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+- uri="ent/isoamsr.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+- uri="ent/isobox.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+- uri="ent/isocyr1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+- uri="ent/isocyr2.ent"/>
+-
+ <!-- End of catalog data for DocBook XML V4.5 ............................. -->
+ <!-- ...................................................................... -->
+
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml
new file mode 100644
index 000000000..b71f559ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook XML HTML Tables V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//ELEMENTS DocBook XML Information Pool V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Information Pool V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook XML HTML Tables V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Information Pool V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.1//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//ENTITIES DocBook XML Notations V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Information Pool V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//DTD CALS Table Model XML V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//ENTITIES DocBook XML Character Entities V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//ELEMENTS DocBook XML Document Hierarchy V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Normal Walsh//Exchange Table Model 19960430 XML V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://docbook.org/xml/4.4/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://docbook.org/xml/4.1/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//DTD DocBk XML V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook XML Information Pool V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//DTD DocBook XML V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://docbook.org/xml/4.1.2/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://docbook.org/xml/4.5/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//ENTITIES DocBook XML Additional General Entities V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://docbook.org/xml/4.2/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD XML Exchange Table Model 19990315//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://docbook.org/xml/4.3/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Information Pool V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.1/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+</catalog>
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
new file mode 100644
index 000000000..de1bc3970
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb
@@ -0,0 +1,64 @@
+SUMMARY = "Document type definitions for verification of XML data files"
+DESCRIPTION = "Document type definitions for verification of XML data \
+files against the DocBook rule set, it ships with the latest DocBook 4.5 \
+XML DTD, as well as a selected set of legacy DTDs for use with older \
+documents, including 4.0, 4.1.2, 4.2, 4.3 and 4.4"
+HOMEPAGE = "http://www.docbook.org/xml/"
+
+LICENSE = "OASIS"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE-OASIS;md5=c608985dd5f7f215e669e7639a0b1d2e"
+
+# 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 = "${DEBIAN_MIRROR}/main/d/docbook-xml/docbook-xml_${PV}.orig.tar.gz \
+ file://LICENSE-OASIS \
+ file://docbook-xml-update-catalog.xml.patch \
+ file://docbook-xml.xml \
+"
+
+SRC_URI[md5sum] = "487b4d44e15cffb1f4048af23f98208e"
+SRC_URI[sha256sum] = "b0f8edcf697f5318e63dd98c9a931f3fee167af0805ba441db372e0f17b2a44f"
+
+S="${WORKDIR}/docbook-xml-4.5.c31424"
+
+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_compile (){
+ :
+}
+
+do_install () {
+ # Refer debian https://packages.debian.org/sid/all/docbook-xml/filelist
+ for DTDVERSION in 4.0 4.1.2 4.2 4.3 4.4 4.5; do
+ install -d -m 755 ${D}${datadir}/xml/docbook/schema/dtd/${DTDVERSION}
+ cp -v -R docbook-${DTDVERSION}/* ${D}${datadir}/xml/docbook/schema/dtd/${DTDVERSION}
+ done
+
+ install -d ${D}${sysconfdir}/xml/
+ 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
+}
+
+FILES_${PN} = "${datadir}/* ${sysconfdir}/xml/docbook-xml.xml"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch
new file mode 100644
index 000000000..0559a5c0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch
@@ -0,0 +1,24 @@
+docbook-xsl-stylesheets: no bashism in docbook-xsl-update
+
+The checkbashisms shows there is no bashism, so use /bin/sh.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ tools/bin/docbook-xsl-update | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/bin/docbook-xsl-update b/tools/bin/docbook-xsl-update
+index aba0016..cc73aa2 100755
+--- a/tools/bin/docbook-xsl-update
++++ b/tools/bin/docbook-xsl-update
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # vim: number
+
+ # docbook-xsl-update - Update environment to latest docbook-xsl snapshot
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml
new file mode 100644
index 000000000..a1a576a2e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+<delegateURI uriStartString="http://docbook.sourceforge.net/release/xsl/" catalog="file:///usr/share/xml/docbook/xsl-stylesheets-1.78.1/catalog.xml"/>
+<delegateSystem systemIdStartString="http://docbook.sourceforge.net/release/xsl/" catalog="file:///usr/share/xml/docbook/xsl-stylesheets-1.78.1/catalog.xml"/>
+</catalog>
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.78.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.78.1.bb
new file mode 100644
index 000000000..52de3ab04
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.78.1.bb
@@ -0,0 +1,74 @@
+SUMMARY = "XSL stylesheets for processing DocBook XML to various output formats"
+HOMEPAGE = "http://docbook.sourceforge.net"
+LICENSE = "XSL"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6eeeed43d498c22a835382533356462"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/docbook/docbook-xsl-${PV}.tar.bz2 \
+ file://docbook-xsl.xml \
+ file://docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch \
+"
+
+SRC_URI[md5sum] = "6dd0f89131cc35bf4f2ed105a1c17771"
+SRC_URI[sha256sum] = "c98f7296ab5c8ccd2e0bc07634976a37f50847df2d8a59bdb1e157664700b467"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/docbook/files/docbook-xsl/"
+# Reject versions ending in .0 as those are release candidates
+UPSTREAM_CHECK_REGEX = "/docbook-xsl/(?P<pver>(\d+[\.\-_]*)+(?!\.0)\.\d+)/"
+
+S = "${WORKDIR}/docbook-xsl-${PV}"
+
+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 (){
+ :
+}
+
+do_compile (){
+ :
+}
+
+do_install () {
+ # Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/docbook-xsl.html
+ # for details.
+ install -v -m755 -d ${D}${datadir}/xml/docbook/xsl-stylesheets-${PV}
+ ln -s xsl-stylesheets-${PV} ${D}${datadir}/xml/docbook/xsl-stylesheets
+
+ cp -v -R VERSION common eclipse epub extensions fo highlighting html \
+ htmlhelp images javahelp lib manpages params profiling \
+ roundtrip slides template tests tools webhelp website \
+ xhtml xhtml-1_1 catalog.xml \
+ ${D}${datadir}/xml/docbook/xsl-stylesheets-1.78.1
+
+ ln -s VERSION ${D}/${datadir}/xml/docbook/xsl-stylesheets-1.78.1/VERSION.xsl
+
+ install -v -m644 -D README \
+ ${D}${datadir}/doc/docbook-xsl-1.78.1/README.txt
+ install -v -m644 RELEASE-NOTES* NEWS* \
+ ${D}${datadir}/doc/docbook-xsl-1.78.1
+
+ install -d ${D}${sysconfdir}/xml/
+ install -m 755 ${WORKDIR}/docbook-xsl.xml ${D}${sysconfdir}/xml/docbook-xsl.xml
+
+}
+
+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
+}
+
+RDEPENDS_${PN} += "perl"
+FILES_${PN} = "${datadir}/xml/* ${sysconfdir}/xml/docbook-xsl.xml"
+FILES_${PN}-doc = "${datadir}/doc/*"
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
new file mode 100644
index 000000000..06f5b7a96
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-Include-fcntl.h-for-getting-loff_t-definition.patch
@@ -0,0 +1,41 @@
+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/0001-mkfs.fat-fix-incorrect-int-type.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-mkfs.fat-fix-incorrect-int-type.patch
new file mode 100644
index 000000000..3497ca540
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/0001-mkfs.fat-fix-incorrect-int-type.patch
@@ -0,0 +1,46 @@
+From 3b95786af13e28157d889bd90a384ee255f2d91d Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Date: Sun, 16 Aug 2015 15:55:43 +0200
+Subject: [PATCH] mkfs.fat: fix incorrect int type
+
+u_int32_t is not a stanard type, while uint32_t is. This fixes builds
+with the musl C library, which only defines so-called "clean" headers;
+build failures are like (back-quotes and elision manually added for
+readability):
+
+ http://autobuild.buildroot.org/results/a09/a0923d7f6d4dbae02eba4c5024bbdae3a52aa85a/build-end.log
+
+ /home/peko/autobuild/instance-1/output/host/usr/bin/x86_64-linux-gcc -D_LARGEFILE_SOURCE \
+ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -D_GNU_SOURCE -D_LARGEFILE_SOURCE \
+ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o mkfs.fat.o src/mkfs.fat.c
+ src/mkfs.fat.c: In function 'main':
+ src/mkfs.fat.c:1415:18: error: 'u_int32_t' undeclared (first use in this function)
+ volume_id = (u_int32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); [...]
+ ^
+ src/mkfs.fat.c:1415:18: note: each undeclared identifier is reported only once for each
+ function it appears in
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Signed-off-by: Andreas Bombe <aeb@debian.org>
+---
+Upstream-Status: Backport
+
+ src/mkfs.fat.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mkfs.fat.c b/src/mkfs.fat.c
+index b38d116..dddbe24 100644
+--- a/src/mkfs.fat.c
++++ b/src/mkfs.fat.c
+@@ -1412,7 +1412,7 @@ int main(int argc, char **argv)
+
+ gettimeofday(&create_timeval, NULL);
+ create_time = create_timeval.tv_sec;
+- volume_id = (u_int32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); /* Default volume ID = creation time, fudged for more uniqueness */
++ volume_id = (uint32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); /* Default volume ID = creation time, fudged for more uniqueness */
+ check_atari();
+
+ printf("mkfs.fat " VERSION " (" VERSION_DATE ")\n");
+--
+2.7.0
+
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
new file mode 100644
index 000000000..b46b2db0a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch
@@ -0,0 +1,38 @@
+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
new file mode 100644
index 000000000..35abd1a2b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch
@@ -0,0 +1,37 @@
+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
new file mode 100644
index 000000000..9d7f7321a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/fix_populated_dosfs_creation.patch
@@ -0,0 +1,489 @@
+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
new file mode 100644
index 000000000..ab5c8cf8c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch
@@ -0,0 +1,22 @@
+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/largefile.patch b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/largefile.patch
new file mode 100644
index 000000000..7f7d8359d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/largefile.patch
@@ -0,0 +1,19 @@
+defer setting largefile flags to build makery
+in a cross build we can not do runtime config tests
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate[Cross compile Specific]
+Index: dosfstools-3.0.28/Makefile
+===================================================================
+--- dosfstools-3.0.28.orig/Makefile
++++ dosfstools-3.0.28/Makefile
+@@ -27,8 +27,7 @@ SBINDIR = $(PREFIX)/sbin
+ DOCDIR = $(PREFIX)/share/doc
+ MANDIR = $(PREFIX)/share/man
+
+-#OPTFLAGS = -O2 -fomit-frame-pointer -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+-OPTFLAGS = -O2 -fomit-frame-pointer -D_GNU_SOURCE $(shell getconf LFS_CFLAGS)
++OPTFLAGS = -O2 -fomit-frame-pointer
+ #WARNFLAGS = -Wall -pedantic -std=c99
+ WARNFLAGS = -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings
+ DEBUGFLAGS = -g
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
new file mode 100644
index 000000000..ae21bee78
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch
@@ -0,0 +1,241 @@
+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
new file mode 100644
index 000000000..3ba4711d1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
@@ -0,0 +1,639 @@
+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
new file mode 100644
index 000000000..11e8a7594
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch
@@ -0,0 +1,19 @@
+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
new file mode 100644
index 000000000..848a76b99
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch
@@ -0,0 +1,27 @@
+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
new file mode 100644
index 000000000..176504d4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
@@ -0,0 +1,34 @@
+# 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_3.0.28.bb b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_3.0.28.bb
new file mode 100644
index 000000000..6fc3e41df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dosfstools/dosfstools_3.0.28.bb
@@ -0,0 +1,31 @@
+# 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/v3.0.28/dosfstools-3.0.28.tar.xz \
+ file://largefile.patch \
+ file://0001-mkfs.fat-fix-incorrect-int-type.patch \
+ "
+SRC_URI[md5sum] = "6a047a6c65186b9ebb1853709adb36db"
+SRC_URI[sha256sum] = "ee95913044ecf2719b63ea11212917649709a6e53209a72d622135aaa8517ee2"
+
+UPSTREAM_CHECK_URI = "https://github.com/dosfstools/dosfstools/releases"
+
+CFLAGS += "-D_GNU_SOURCE ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', '', d)}"
+
+FILES_${PN} = "${base_sbindir}"
+FILES_${PN}-doc = "${mandir} ${docdir}"
+
+do_install () {
+ oe_runmake "PREFIX=${D}${prefix}" "SBINDIR=${D}${base_sbindir}" \
+ "MANDIR=${D}${mandir}" "DOCDIR=${D}${docdir}" install
+}
+
+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
new file mode 100644
index 000000000..3d9e7e305
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg.inc
@@ -0,0 +1,79 @@
+SUMMARY = "Package maintenance system from Debian"
+LICENSE = "GPLv2.0+"
+SECTION = "base"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz"
+
+SRC_URI_append_class-native = " file://0001-When-running-do_package_write_deb-we-have-trees-of-h.patch"
+
+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"
+
+inherit autotools gettext perlnative pkgconfig systemd
+
+python () {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ pn = d.getVar('PN', True)
+ 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"
+
+EXTRA_OECONF = "\
+ --disable-dselect \
+ --enable-start-stop-daemon \
+ --with-zlib \
+ --with-bz2 \
+ --without-liblzma \
+ --without-selinux \
+ "
+
+EXTRA_OECONF += "TAR=tar"
+
+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
+ rm ${D}${bindir}/update-alternatives
+ sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
+ else
+ sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)};then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/dpkg-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/dpkg-configure.service
+ fi
+}
+
+PROV = "virtual/update-alternatives"
+PROV_class-native = ""
+
+PROVIDES += "${PROV}"
+
+PACKAGES =+ "update-alternatives-dpkg"
+FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
+RPROVIDES_update-alternatives-dpkg += "update-alternatives"
+
+PACKAGES += "${PN}-perl"
+FILES_${PN}-perl = "${libdir}/perl"
+
+BBCLASSEXTEND = "native"
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch
new file mode 100644
index 000000000..49ef853ff
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch
@@ -0,0 +1,71 @@
+From e391bdba238d1371fc5b67cdae08b06eb5ada5c2 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 15:48:13 +0300
+Subject: [PATCH] When running do_package_write_deb, we have trees of
+ hardlinked files such as the dbg source files in ${PN}-dbg. If something
+ makes another copy of one of those files (or deletes one), the number of
+ links a file has changes and tar can notice this, e.g.:
+
+| DEBUG: Executing python function do_package_deb
+| dpkg-deb: building package `sed-ptest' in `/media/build1/poky/build/tmp/work/i586-poky-linux/sed/4.2.2-r0/deploy-debs/i586/sed-ptest_4.2.2-r0.3_i386.deb'.
+| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
+| dpkg-deb: error: subprocess tar -cf returned error exit status 1
+
+Tar returns an error of 1 when files 'change' and other errors codes
+in other error cases. We tweak dpkg-deb here so that it ignores an exit
+code of 1 from tar. The files don't really change (and we have locking in
+place to avoid that kind of issue).
+
+Upstream-Status: Inappropriate
+RP 2015/3/27
+---
+ dpkg-deb/build.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
+index 2ddeec6..af363f0 100644
+--- a/dpkg-deb/build.c
++++ b/dpkg-deb/build.c
+@@ -452,7 +452,7 @@ static void
+ tarball_pack(const char *dir, filenames_feed_func *tar_filenames_feeder,
+ struct compress_params *tar_compress_params, int fd_out)
+ {
+- int pipe_filenames[2], pipe_tarball[2];
++ int pipe_filenames[2], pipe_tarball[2], rc;
+ pid_t pid_tar, pid_comp;
+
+ /* Fork off a tar. We will feed it a list of filenames on stdin later. */
+@@ -493,7 +493,9 @@ tarball_pack(const char *dir, filenames_feed_func *tar_filenames_feeder,
+ /* All done, clean up wait for tar and <compress> to finish their job. */
+ close(pipe_filenames[1]);
+ subproc_reap(pid_comp, _("<compress> from tar -cf"), 0);
+- subproc_reap(pid_tar, "tar -cf", 0);
++ rc = subproc_reap(pid_tar, "tar -cf", SUBPROC_RETERROR);
++ if (rc && rc != 1)
++ ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
+ }
+
+ /**
+@@ -509,7 +511,7 @@ do_build(const char *const *argv)
+ char *debar;
+ char *tfbuf;
+ int arfd;
+- int p1[2], gzfd;
++ int p1[2], gzfd, rc;
+ pid_t c1, c2;
+
+ /* Decode our arguments. */
+@@ -590,7 +592,9 @@ do_build(const char *const *argv)
+ }
+ close(p1[0]);
+ subproc_reap(c2, _("<compress> from tar -cf"), 0);
+- subproc_reap(c1, "tar -cf", 0);
++ rc = subproc_reap(c1, "tar -cf", SUBPROC_RETERROR);
++ if (rc && rc != 1)
++ ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
+
+ if (lseek(gzfd, 0, SEEK_SET))
+ ohshite(_("failed to rewind temporary file (%s)"), _("control member"));
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch
new file mode 100644
index 000000000..231a6a290
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch
@@ -0,0 +1,38 @@
+From b4ea54158c399874e12394ebc91afe98954695e2 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:16:16 +0300
+Subject: [PATCH 2/5] Adapt to linux-wrs kernel version, which has character
+ '_' inside. Remove the first-char-digit-check (as the 1.15.8.5 version does).
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ lib/dpkg/parsehelp.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/lib/dpkg/parsehelp.c b/lib/dpkg/parsehelp.c
+index 79b2908..7758aa5 100644
+--- a/lib/dpkg/parsehelp.c
++++ b/lib/dpkg/parsehelp.c
+@@ -235,14 +235,12 @@ parseversion(struct dpkg_version *rversion, const char *string,
+
+ /* XXX: Would be faster to use something like cisversion and cisrevision. */
+ ptr = rversion->version;
+- if (*ptr && !c_isdigit(*ptr++))
+- return dpkg_put_warn(err, _("version number does not start with digit"));
+ for (; *ptr; ptr++) {
+- if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~:", *ptr) == NULL)
++ if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~:_", *ptr) == NULL)
+ return dpkg_put_warn(err, _("invalid character in version number"));
+ }
+ for (ptr = rversion->revision; *ptr; ptr++) {
+- if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".+~", *ptr) == NULL)
++ if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~_", *ptr) == NULL)
+ return dpkg_put_warn(err, _("invalid character in revision number"));
+ }
+
+--
+2.1.4
+
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
new file mode 100644
index 000000000..9f77c6c99
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
@@ -0,0 +1,60 @@
+From 24229971492515b64c81e8c6392e5dfbdc22b44c Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:25:45 +0300
+Subject: [PATCH 3/5] Our pre/postinsts expect $D to be set when running in a
+ sysroot and don't expect a chroot. This matches up our system expectations
+ with what dpkg does.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2011/12/07
+---
+ src/script.c | 31 ++-----------------------------
+ 1 file changed, 2 insertions(+), 29 deletions(-)
+
+diff --git a/src/script.c b/src/script.c
+index a958145..24c49f9 100644
+--- a/src/script.c
++++ b/src/script.c
+@@ -100,36 +100,9 @@ maintscript_pre_exec(struct command *cmd)
+ size_t instdirl = strlen(instdir);
+
+ if (*instdir) {
+- if (strncmp(admindir, instdir, instdirl) != 0)
+- ohshit(_("admindir must be inside instdir for dpkg to work properly"));
+- if (setenv("DPKG_ADMINDIR", admindir + instdirl, 1) < 0)
+- ohshite(_("unable to setenv for subprocesses"));
+-
+- if (chroot(instdir))
+- ohshite(_("failed to chroot to '%.250s'"), instdir);
+- }
+- /* Switch to a known good directory to give the maintainer script
+- * a saner environment, also needed after the chroot(). */
+- if (chdir("/"))
+- ohshite(_("failed to chdir to '%.255s'"), "/");
+- if (debug_has_flag(dbg_scripts)) {
+- struct varbuf args = VARBUF_INIT;
+- const char **argv = cmd->argv;
+-
+- while (*++argv) {
+- varbuf_add_char(&args, ' ');
+- varbuf_add_str(&args, *argv);
+- }
+- varbuf_end_str(&args);
+- debug(dbg_scripts, "fork/exec %s (%s )", cmd->filename,
+- args.buf);
+- varbuf_destroy(&args);
++ setenv("D", instdir, 1);
+ }
+- if (!instdirl)
+- return cmd->filename;
+-
+- assert(strlen(cmd->filename) >= instdirl);
+- return cmd->filename + instdirl;
++ return cmd->filename;
+ }
+
+ /**
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch
new file mode 100644
index 000000000..56c85c773
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch
@@ -0,0 +1,31 @@
+From adb6bfd0feeceaf030df0debe3343d7f73e708a0 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:27:45 +0300
+Subject: [PATCH 4/5] The lutimes function doesn't work properly for all
+ systems.
+
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ src/archives.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/archives.c b/src/archives.c
+index bff5f14..b711013 100644
+--- a/src/archives.c
++++ b/src/archives.c
+@@ -449,8 +449,9 @@ tarobject_set_mtime(struct tar_entry *te, const char *path)
+
+ if (te->type == TAR_FILETYPE_SYMLINK) {
+ #ifdef HAVE_LUTIMES
+- if (lutimes(path, tv) && errno != ENOSYS)
++/* if (lutimes(path, tv) && errno != ENOSYS)
+ ohshite(_("error setting timestamps of '%.255s'"), path);
++*/
+ #endif
+ } else {
+ if (utimes(path, tv))
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch
new file mode 100644
index 000000000..96e96f277
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch
@@ -0,0 +1,36 @@
+From 0ad7bba80d5b9035089ff2b2f77a774b5b201915 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:28:59 +0300
+Subject: [PATCH 5/5] dpkg-compiler.m4: remove -Wvla
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Remove the -Wvla flag from the set of compiler warning flags, since gcc
+on old host systems such as CentOS 5.8 doesn't support it, and it
+causes a build error for dpkg-native.
+
+Upstream-Status: Pending
+
+Signed-off-by: Donn Seeley <donn.seeley@windriver.com>
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ m4/dpkg-compiler.m4 | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4
+index 682857c..23ed7d0 100644
+--- a/m4/dpkg-compiler.m4
++++ b/m4/dpkg-compiler.m4
+@@ -52,7 +52,6 @@ AC_DEFUN([DPKG_CHECK_COMPILER_WARNINGS], [
+ DPKG_CHECK_COMPILER_FLAG([-Wlogical-op])
+ DPKG_CHECK_COMPILER_FLAG([-Wlogical-not-parentheses])
+ DPKG_CHECK_COMPILER_FLAG([-Wswitch-bool])
+- DPKG_CHECK_COMPILER_FLAG([-Wvla])
+ DPKG_CHECK_COMPILER_FLAG([-Winit-self])
+ DPKG_CHECK_COMPILER_FLAG([-Wwrite-strings])
+ DPKG_CHECK_COMPILER_FLAG([-Wcast-align])
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch
new file mode 100644
index 000000000..a6b00880c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch
@@ -0,0 +1,42 @@
+From f8910022dc3ec622272f168cd0022dbdf6dff93a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Dec 2015 23:05:41 +0000
+Subject: [PATCH] add musleabi to known target tripets
+
+helps compiling dpkg for musl/arm-softfloat
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ ostable | 1 +
+ triplettable | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/ostable b/ostable
+index 3bb6819..d0ffdc7 100644
+--- a/ostable
++++ b/ostable
+@@ -15,6 +15,7 @@
+ uclibceabi-linux linux-uclibceabi linux[^-]*-uclibceabi
+ uclibc-linux linux-uclibc linux[^-]*-uclibc
+ musleabihf-linux linux-musleabihf linux[^-]*-musleabihf
++musleabi-linux linux-musleabi linux[^-]*-musleabi
+ musl-linux linux-musl linux[^-]*-musl
+ gnueabihf-linux linux-gnueabihf linux[^-]*-gnueabihf
+ gnueabi-linux linux-gnueabi linux[^-]*-gnueabi
+diff --git a/triplettable b/triplettable
+index 1213584..70d24c1 100644
+--- a/triplettable
++++ b/triplettable
+@@ -6,6 +6,7 @@
+ uclibceabi-linux-arm uclibc-linux-armel
+ uclibc-linux-<cpu> uclibc-linux-<cpu>
+ musleabihf-linux-arm musl-linux-armhf
++musleabi-linux-arm musl-linux-armel
+ musl-linux-<cpu> musl-linux-<cpu>
+ gnueabihf-linux-arm armhf
+ gnueabi-linux-arm armel
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch
new file mode 100644
index 000000000..af275dec1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch
@@ -0,0 +1,38 @@
+Author: Krishnanjanappa, Jagadeesh <jagadeesh.krishnanjanappa@caviumnetworks.com>
+Date: Wed Apr 8 18:08:14 2015 +0530
+
+[PATCH] add armeb triplet entry into triplettable.
+
+Cross-compling dpkg application for armeb fails with below error
+during configure task,
+
+(snip)
+ configure:23141: checking dpkg cpu type
+ configure:23148: result: armeb
+ configure:23150: WARNING: armeb not found in cputable
+ configure:23162: checking dpkg operating system type
+ configure:23169: result: linux-gnueabi
+ configure:23171: WARNING: linux-gnueabi not found in ostable
+ configure:23183: checking dpkg architecture name
+ configure:23189: error: cannot determine host dpkg architecture
+-- CUT --
+
+the required combination of "gnueabi-linux-armeb" was not found in
+the triplettable file thereby returning dpkg_arch as
+empty in configure script.
+
+Upstream-Status: Pending
+
+Signed-off-by: Krishnanjanappa, Jagadeesh <jagadeesh.krishnanjanappa@caviumnetworks.com>
+
+diff -Naurp dpkg-1.17.21_org/triplettable dpkg-1.17.21/triplettable
+--- dpkg-1.17.21_org/triplettable 2015-04-08 17:08:52.370759171 +0530
++++ dpkg-1.17.21/triplettable 2015-04-08 17:09:12.406752081 +0530
+@@ -9,6 +9,7 @@ musleabihf-linux-arm musl-linux-armhf
+ musl-linux-<cpu> musl-linux-<cpu>
+ gnueabihf-linux-arm armhf
+ gnueabi-linux-arm armel
++gnueabi-linux-armeb armeb
+ gnuabin32-linux-mips64el mipsn32el
+ gnuabin32-linux-mips64 mipsn32
+ gnuabi64-linux-mips64el mips64el
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch
new file mode 100644
index 000000000..cad4c0f0a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch
@@ -0,0 +1,22 @@
+configure cannot determine the proper cpu, os, or
+architecture for mips64, and possibly other arch's
+because of faulty code added to Arch.pm in the latest
+release from upstream. We remove that code.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+
+--- a/scripts/Dpkg/Arch.pm
++++ b/scripts/Dpkg/Arch.pm
+@@ -233,9 +233,6 @@ sub read_triplettable()
+ (my $dt = $debtriplet) =~ s/<cpu>/$_cpu/;
+ (my $da = $debarch) =~ s/<cpu>/$_cpu/;
+
+- next if exists $debarch_to_debtriplet{$da}
+- or exists $debtriplet_to_debarch{$dt};
+-
+ $debarch_to_debtriplet{$da} = $dt;
+ $debtriplet_to_debarch{$dt} = $da;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service
new file mode 100644
index 000000000..f0b0789e4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=dpkg first boot configure
+DefaultDependencies=no
+After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
+Before=sysinit.target
+
+[Service]
+Type=oneshot
+EnvironmentFile=-@SYSCONFDIR@/default/postinst
+ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/dpkg --configure -a > $LOGFILE 2>&1; else @BINDIR@/dpkg --configure -a; fi"
+ExecStartPost=@BASE_BINDIR@/systemctl disable dpkg-configure.service
+StandardOutput=syslog
+RemainAfterExit=No
+
+[Install]
+WantedBy=basic.target
+WantedBy=sysinit.target
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch
new file mode 100644
index 000000000..e73311c29
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch
@@ -0,0 +1,40 @@
+Upstream-Status: Pending
+
+dpkg defines:
+#define DPKG_BEGIN_DECLS extern "C" {
+
+That makes header cstdlib included in a extern "C" block which is not supported
+by gcc 4.8. It fails on Fedora 19:
+
+/usr/include/c++/4.8.1/cstdlib: In function ‘long long int std::abs(long long int)’:
+/usr/include/c++/4.8.1/cstdlib:174:20: error: declaration of C function ‘long long int std::abs(long long int)’ conflicts with
+ abs(long long __x) { return __builtin_llabs (__x); }
+ ^
+/usr/include/c++/4.8.1/cstdlib:166:3: error: previous declaration ‘long int std::abs(long int)’ here
+ abs(long __i) { return __builtin_labs(__i); }
+ ^
+
+Move include gettext.h out of the extern "C" block to fix this issue.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+--- dpkg-1.17.1/lib/dpkg/i18n.h.orig 2013-08-13 17:31:28.870935573 +0800
++++ dpkg-1.17.1/lib/dpkg/i18n.h 2013-08-13 17:31:37.893065249 +0800
+@@ -23,8 +23,6 @@
+
+ #include <dpkg/macros.h>
+
+-DPKG_BEGIN_DECLS
+-
+ /**
+ * @defgroup i18n Internationalization support
+ * @ingroup dpkg-internal
+@@ -33,6 +31,8 @@
+
+ #include <gettext.h>
+
++DPKG_BEGIN_DECLS
++
+ /* We need to include this because pgettext() uses LC_MESSAGES, but libintl.h
+ * which gets pulled by gettext.h only includes it if building optimized. */
+ #include <locale.h>
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch
new file mode 100644
index 000000000..d56b8a69a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch
@@ -0,0 +1,86 @@
+CentOS 5.8 kernels and headers support the sync_file_range() system call,
+but glibc 2.5 doesn't provide the syscall stub. It appears that this
+problem is known but will never be fixed:
+
+ https://bugzilla.redhat.com/show_bug.cgi?id=518581
+
+ Bug 518581 - [RHEL5] glibc misses sync_file_range syscall interface
+
+ Status: CLOSED CANTFIX
+ Last Closed: 2009-11-22 22:19:55
+
+ Kirby Zhou 2009-08-20 23:37:55 EDT
+
+ Description of problem:
+
+ glibc misses sync_file_range syscall interface. The header file and
+ man page both say 'sync_file_range' should exist. From man page,
+ sync_file_range should exist sinc kernel-2.6.17
+
+ Andreas Schwab 2009-08-21 03:24:24 EDT
+
+ It has only been added to glibc 2.6, and cannot be backported due to
+ ABI breakage. You can always fall back to syscall(3).
+
+ Ulrich Drepper 2009-11-22 22:19:55 EST
+
+ As comment #1 says, no chance to backport this.
+
+ See the syscall man page for instructions.
+
+ Jon E 2010-03-19 10:32:37 EDT
+
+ then why document it if it's broken and you're not going to fix it?
+ .. might want to FTFM over at sync_file_range(2) - in the meantime -
+ borrowing from glibc 2.6 .. any thoughts on this implementation for a
+ hacky workaround for those still on your "ancient releases" .. (eg:
+ RHEL5.3)?:
+
+ #ifdef ULI_WONT_FIX_THIS_IN_GLIBC2.5
+ #define NR_sync_file_range 277
+ int sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+ {
+ return syscall (NR_sync_file_range, fd,
+ __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+ __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+ flags);
+ }
+ #endif
+
+ assuming of course that you're on an x86_64 and include/asm-
+ x86_64/unistd.h has the correct entry
+
+ (fwiw - fio is starting to use this now)
+
+Rather than attempting to provide an implementation using syscall(),
+we take the more conservative route and ignore header support for
+sync_file_range() flags when the glibc version is <= 2.5.
+
+Upstream-Status: Inappropriate [everyone else builds on newer hosts :-)]
+
+Signed-off-by: Donn Seeley <donn.seeley@windriver.com>
+Signed-off-by: Lei Liu <lei.liu2@windriver.com>
+---
+ src/archives.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/src/archives.c
++++ b/src/archives.c
+@@ -75,7 +75,7 @@
+ /* Ignore the return code as it should be considered equivalent to an
+ * asynchronous hint for the kernel, we are doing an fsync() later on
+ * anyway. */
+-#if defined(SYNC_FILE_RANGE_WRITE)
++#if defined(SYNC_FILE_RANGE_WRITE) && __GLIBC_PREREQ(2, 6)
+ sync_file_range(fd, 0, 0, SYNC_FILE_RANGE_WRITE);
+ #elif defined(HAVE_POSIX_FADVISE)
+ posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
+@@ -1179,7 +1179,7 @@
+ return 0;
+ }
+
+-#if defined(SYNC_FILE_RANGE_WAIT_BEFORE)
++#if defined(SYNC_FILE_RANGE_WAIT_BEFORE) && __GLIBC_PREREQ(2, 6)
+ static void
+ tar_writeback_barrier(struct fileinlist *files, struct pkginfo *pkg)
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/noman.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/noman.patch
new file mode 100644
index 000000000..d30c15018
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/noman.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Inappropriate [disable feature]
+
+diff -ruN dpkg-1.15.8.5-orig/Makefile.am dpkg-1.15.8.5/Makefile.am
+--- dpkg-1.15.8.5-orig/Makefile.am 2010-10-08 12:27:15.042083703 +0800
++++ dpkg-1.15.8.5/Makefile.am 2010-10-08 12:27:27.755148228 +0800
+@@ -12,8 +12,7 @@
+ utils \
+ $(MAYBE_DSELECT) \
+ scripts \
+- po \
+- man
++ po
+
+ ACLOCAL_AMFLAGS = -I m4
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch
new file mode 100644
index 000000000..4f408ff77
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch
@@ -0,0 +1,17 @@
+busybox-1.19.4 tar utility doesn't support --warning=no-timestamp
+
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+Index: dpkg-1.17.1/dpkg-deb/extract.c
+===================================================================
+--- dpkg-1.17.1.orig/dpkg-deb/extract.c
++++ dpkg-1.17.1/dpkg-deb/extract.c
+@@ -318,7 +318,6 @@ extracthalf(const char *debar, const cha
+
+ command_add_arg(&cmd, "-f");
+ command_add_arg(&cmd, "-");
+- command_add_arg(&cmd, "--warning=no-timestamp");
+
+ m_dup2(p2[0],0);
+ close(p2[0]);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.4.bb
new file mode 100644
index 000000000..7876944d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/dpkg/dpkg_1.18.4.bb
@@ -0,0 +1,20 @@
+require dpkg.inc
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI_append_class-native =" file://glibc2.5-sync_file_range.patch "
+SRC_URI += "file://noman.patch \
+ file://remove-tar-no-timestamp.patch \
+ file://fix-abs-redefine.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[md5sum] = "e95b513c89693f6ec3ab53b6b1c3defd"
+SRC_URI[sha256sum] = "fe89243868888ce715bf45861f26264f767d4e4dbd0d6f1a26ce60bbbbf106da"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc
new file mode 100644
index 000000000..09e4ea5bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc
@@ -0,0 +1,27 @@
+SUMMARY = "Ext2 Filesystem Utilities"
+DESCRIPTION = "The Ext2 Filesystem Utilities (e2fsprogs) contain all of the standard utilities for creating, \
+fixing, configuring , and debugging ext2 filesystems."
+HOMEPAGE = "http://e2fsprogs.sourceforge.net/"
+
+LICENSE = "GPLv2 & LGPLv2 & BSD & MIT"
+LICENSE_e2fsprogs-e2fsck = "GPLv2"
+LICENSE_e2fsprogs-mke2fs = "GPLv2"
+LICENSE_e2fsprogs-fsck = "GPLv2"
+LICENSE_e2fsprogs-tune2fs = "GPLv2"
+LICENSE_e2fsprogs-badblocks = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b48f21d765b875bd10400975d12c1ca2 \
+ file://lib/ext2fs/ext2fs.h;beginline=1;endline=9;md5=596a8dedcb4e731c6b21c7a46fba6bef \
+ file://lib/e2p/e2p.h;beginline=1;endline=7;md5=8a74ade8f9d65095d70ef2d4bf48e36a \
+ file://lib/uuid/uuid.h.in;beginline=1;endline=32;md5=dbb8079e114a5f841934b99e59c8820a \
+ file://lib/uuid/COPYING;md5=58dcd8452651fc8b07d1f65ce07ca8af \
+ 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"
+
+SRC_URI = "git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git"
+S = "${WORKDIR}/git"
+
+inherit autotools gettext texinfo pkgconfig multilib_header update-alternatives ptest
+
+BBCLASSEXTEND = "native nativesdk"
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
new file mode 100644
index 000000000..656fb6efb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch
@@ -0,0 +1,34 @@
+From 0a392baf1874964651115d9f77b0daa6851d1daa Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Tue, 1 Mar 2016 14:28:01 +1100
+Subject: [PATCH] Revert "mke2fs: enable the metadata_csum and 64bit features
+ by default"
+
+This reverts commit cd27af3ecb83e8fd1e3eaa14994284a1818c7c15 as we
+don't want to enable features by default that are not supported by
+the latest stable e2fsprogs release.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ misc/mke2fs.conf.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in
+index a049d61..106ee80 100644
+--- a/misc/mke2fs.conf.in
++++ b/misc/mke2fs.conf.in
+@@ -11,7 +11,8 @@
+ features = has_journal
+ }
+ ext4 = {
+- features = has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize
++ features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
++ auto_64-bit_support = 1
+ inode_size = 256
+ }
+ ext4dev = {
+--
+2.7.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/acinclude.m4 b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/acinclude.m4
new file mode 100644
index 000000000..c0bd7dbde
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/acinclude.m4
@@ -0,0 +1,135 @@
+# Extracted from the package's shipped aclocal.m4. Custom macros should be in
+# acinclude.m4 so running aclocal doesn't blow them away.
+#
+# Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+# from http://autoconf-archive.cryp.to/ax_tls.html
+#
+# This was licensed under the GPL with the following exception:
+#
+# 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 Macro 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.
+#
+AC_DEFUN([AX_TLS], [
+ AC_MSG_CHECKING(for thread local storage (TLS) class)
+ AC_CACHE_VAL(ac_cv_tls, [
+ ax_tls_keywords="__thread __declspec(thread) none"
+ for ax_tls_keyword in $ax_tls_keywords; do
+ case $ax_tls_keyword in
+ none) ac_cv_tls=none ; break ;;
+ *)
+ AC_TRY_COMPILE(
+ [#include <stdlib.h>
+ static void
+ foo(void) {
+ static ] $ax_tls_keyword [ int bar;
+ exit(1);
+ }],
+ [],
+ [ac_cv_tls=$ax_tls_keyword ; break],
+ ac_cv_tls=none
+ )
+ esac
+ done
+])
+
+ if test "$ac_cv_tls" != "none"; then
+ dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
+ AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
+ fi
+ AC_MSG_RESULT($ac_cv_tls)
+])
+
+# ===========================================================================
+# http://www.nongnu.org/autoconf-archive/check_gnu_make.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# CHECK_GNU_MAKE()
+#
+# DESCRIPTION
+#
+# This macro searches for a GNU version of make. If a match is found, the
+# makefile variable `ifGNUmake' is set to the empty string, otherwise it
+# is set to "#". This is useful for including a special features in a
+# Makefile, which cannot be handled by other versions of make. The
+# variable _cv_gnu_make_command is set to the command to invoke GNU make
+# if it exists, the empty string otherwise.
+#
+# Here is an example of its use:
+#
+# Makefile.in might contain:
+#
+# # A failsafe way of putting a dependency rule into a makefile
+# $(DEPEND):
+# $(CC) -MM $(srcdir)/*.c > $(DEPEND)
+#
+# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
+# @ifGNUmake@ include $(DEPEND)
+# @ifGNUmake@ endif
+#
+# Then configure.in would normally contain:
+#
+# CHECK_GNU_MAKE()
+# AC_OUTPUT(Makefile)
+#
+# Then perhaps to cause gnu make to override any other make, we could do
+# something like this (note that GNU make always looks for GNUmakefile
+# first):
+#
+# if ! test x$_cv_gnu_make_command = x ; then
+# mv Makefile GNUmakefile
+# echo .DEFAULT: > Makefile ;
+# echo \ $_cv_gnu_make_command \$@ >> Makefile;
+# fi
+#
+# Then, if any (well almost any) other make is called, and GNU make also
+# exists, then the other make wraps the GNU make.
+#
+# LICENSE
+#
+# Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
+#
+# 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.
+#
+# Note: Modified by Ted Ts'o to add @ifNotGNUMake@
+
+AC_DEFUN(
+ [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
+ _cv_gnu_make_command='' ;
+dnl Search all the common names for GNU make
+ for a in "$MAKE" make gmake gnumake ; do
+ if test -z "$a" ; then continue ; fi ;
+ if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
+ _cv_gnu_make_command=$a ;
+ break;
+ fi
+ done ;
+ ) ;
+dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
+ if test "x$_cv_gnu_make_command" != "x" ; then
+ ifGNUmake='' ;
+ ifNotGNUmake='#' ;
+ else
+ ifGNUmake='#' ;
+ ifNotGNUmake='' ;
+ AC_MSG_RESULT("Not found");
+ fi
+ AC_SUBST(ifGNUmake)
+ AC_SUBST(ifNotGNUmake)
+] )
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir.patch
new file mode 100644
index 000000000..2a3aeff61
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index c1fe224..f5ac628 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1374,7 +1374,8 @@ if test -n "$WITH_DIET_LIBC" ; then
+ INCLUDES="$INCLUDES -D_REENTRANT"
+ fi
+ AC_SUBST(INCLUDES)
+-AM_MKINSTALLDIRS
++MKINSTALLDIRS="mkdir -p"
++AC_SUBST(MKINSTALLDIRS)
+ dnl
+ dnl Build CFLAGS
+ dnl
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
new file mode 100644
index 000000000..ef1ce5872
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch
@@ -0,0 +1,67 @@
+diff --git a/tests/Makefile.in b/tests/Makefile.in
+index 60cf655..ce220f1 100644
+--- a/tests/Makefile.in
++++ b/tests/Makefile.in
+@@ -18,7 +18,7 @@ test_one: $(srcdir)/test_one.in Makefile mke2fs.conf
+ @echo "#!/bin/sh" > test_one
+ @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 "DIFF_OPTS=@UNI_DIFF_OPTS@" >> 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
+ 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
+ @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
+--- a/tests/test_config
++++ b/tests/test_config
+@@ -3,24 +3,24 @@
+ #
+
+ unset LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME PAGER
+-FSCK="$USE_VALGRIND ../e2fsck/e2fsck"
+-MKE2FS="$USE_VALGRIND ../misc/mke2fs"
+-DUMPE2FS="$USE_VALGRIND ../misc/dumpe2fs"
+-TUNE2FS="$USE_VALGRIND ../misc/tune2fs"
+-CHATTR="$USE_VALGRIND../misc/chattr"
+-LSATTR="$USE_VALGRIND ../misc/lsattr"
+-E2IMAGE="$USE_VALGRIND ../misc/e2image"
+-E2IMAGE_EXE="../misc/e2image"
+-DEBUGFS="$USE_VALGRIND ../debugfs/debugfs"
+-DEBUGFS_EXE="../debugfs/debugfs"
+-TEST_BITS="../debugfs/debugfs"
+-RESIZE2FS_EXE="../resize/resize2fs"
++FSCK="$USE_VALGRIND e2fsck"
++MKE2FS="$USE_VALGRIND mke2fs"
++DUMPE2FS="$USE_VALGRIND dumpe2fs"
++TUNE2FS="$USE_VALGRIND tune2fs"
++CHATTR="$USE_VALGRIND chattr"
++LSATTR="$USE_VALGRIND lsattr"
++E2IMAGE="$USE_VALGRIND e2image"
++E2IMAGE_EXE="/sbin/e2image"
++DEBUGFS="$USE_VALGRIND debugfs"
++DEBUGFS_EXE="/sbin/debugfs"
++TEST_BITS="/sbin/debugfs"
++RESIZE2FS_EXE="/sbin/resize2fs"
+ RESIZE2FS="$USE_VALGRIND $RESIZE2FS_EXE"
+-E2UNDO_EXE="../misc/e2undo"
++E2UNDO_EXE="/sbin/e2undo"
+ E2UNDO="$USE_VALGRIND $E2UNDO_EXE"
+-TEST_REL=../tests/progs/test_rel
+-TEST_ICOUNT=../tests/progs/test_icount
+-CRCSUM=../tests/progs/crcsum
++TEST_REL=./progs/test_rel
++TEST_ICOUNT=./progs/test_icount
++CRCSUM=./progs/crcsum
+ 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/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch
new file mode 100644
index 000000000..830e9d57a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch
@@ -0,0 +1,19 @@
+When executing a script don't echo every command, as we do this for entire
+filesystems at rootfs time.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
+index 5590295..ac57292 100644
+--- a/debugfs/debugfs.c
++++ b/debugfs/debugfs.c
+@@ -2378,7 +2378,7 @@ static int source_file(const char *cmd_file, int ss_idx)
+ cp = strchr(buf, '\r');
+ if (cp)
+ *cp = 0;
+- printf("debugfs: %s\n", buf);
++ /*printf("debugfs: %s\n", buf);*/
+ retval = ss_execute_line(ss_idx, buf);
+ if (retval) {
+ ss_perror(ss_idx, retval, buf);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch
new file mode 100644
index 000000000..f3e6eb778
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch
@@ -0,0 +1,44 @@
+From b139e03ac2f72e644e547c7ee9b1514383af4d97 Mon Sep 17 00:00:00 2001
+From: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+Date: Wed, 30 Jan 2013 15:22:04 +0200
+Subject: [PATCH] When /etc/ld.so.cache is writeable by user running bitbake
+ then it creates invalid cache (in my case libstdc++.so
+ cannot be found after building zlib(-native) and I have to
+ call touch */libstdc++.so && /sbin/ldconfig to fix it.
+
+So remove ldconfig call from make install-libs
+
+Patch authored by Martin Jansa.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+---
+ lib/Makefile.elf-lib | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/lib/Makefile.elf-lib b/lib/Makefile.elf-lib
+index 78479d3..4a4a5ac 100644
+--- a/lib/Makefile.elf-lib
++++ b/lib/Makefile.elf-lib
+@@ -50,8 +50,6 @@ install-shlibs install:: $(ELF_LIB) installdirs-elf-lib $(DEP_INSTALL_SYMLINK)
+ $(E) " SYMLINK $(libdir)/$(ELF_IMAGE).so"
+ $(Q) $(INSTALL_SYMLINK) $(ELF_INSTALL_DIR)/$(ELF_SONAME) \
+ $(libdir)/$(ELF_IMAGE).so $(DESTDIR)
+- $(E) " LDCONFIG"
+- $(Q) -$(LDCONFIG)
+
+ install-strip: install
+ $(E) " STRIP-LIB $(ELF_INSTALL_DIR)/$(ELF_LIB)"
+@@ -67,7 +65,6 @@ uninstall-shlibs uninstall::
+ $(RM) -f $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) \
+ $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_SONAME) \
+ $(DESTDIR)$(libdir)/$(ELF_IMAGE).so
+- -$(LDCONFIG)
+
+ clean::
+ $(RM) -rf elfshared
+--
+1.7.9.5
+
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
new file mode 100644
index 000000000..1ac251324
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+cd ./test
+./test_script &>../test.log
+if [ $? -eq 0 ]
+then
+ echo "PASS: e2fsprogs"
+ rm test.log
+else
+ echo "FAIL: e2fsprogs"
+fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/xattr_ordering.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/xattr_ordering.patch
new file mode 100644
index 000000000..782a7b187
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/xattr_ordering.patch
@@ -0,0 +1,219 @@
+From: "Darrick J. Wong" <darrick.wong@oracle.com>
+To: tytso@mit.edu, darrick.wong@oracle.com
+Cc: linux-ext4@vger.kernel.org, Darren Hart <dvhart@linux.intel.com>,
+ Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Sat, 13 Feb 2016 14:38:24 -0800
+Message-ID: <20160213223824.25381.8002.stgit@birch.djwong.org>
+In-Reply-To: <20160213223725.25381.20929.stgit@birch.djwong.org>
+References: <20160213223725.25381.20929.stgit@birch.djwong.org>
+User-Agent: StGit/0.17.1-dirty
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+X-Source-IP: aserv0022.oracle.com [141.146.126.234]
+X-Evolution-Source: 1358860361.4566.33@ted
+Content-Transfer-Encoding: 8bit
+
+Richard Purdie reports that libext2fs doesn't sort attribute keys in
+the xattr block correctly, causing the kernel to return -ENODATA when
+querying attributes that should be there. Therefore, sort attributes
+so that whatever ends up in the xattr block is sorted according to
+what the kernel expects.
+
+Cc: Darren Hart <dvhart@linux.intel.com>
+Reported-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
+---
+ lib/ext2fs/ext_attr.c | 24 +++++++++++-
+ tests/d_xattr_sorting/expect | 29 ++++++++++++++
+ tests/d_xattr_sorting/name | 1
+ tests/d_xattr_sorting/script | 86 ++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 139 insertions(+), 1 deletion(-)
+ create mode 100644 tests/d_xattr_sorting/expect
+ create mode 100644 tests/d_xattr_sorting/name
+ create mode 100644 tests/d_xattr_sorting/script
+
+Upstream-Status: Submitted
+
+
+diff --git a/lib/ext2fs/ext_attr.c b/lib/ext2fs/ext_attr.c
+index 0a4f8c0..b121837 100644
+--- a/lib/ext2fs/ext_attr.c
++++ b/lib/ext2fs/ext_attr.c
+@@ -254,10 +254,15 @@ static struct ea_name_index ea_names[] = {
+ {0, NULL},
+ };
+
++static int find_ea_index(char *fullname, char **name, int *index);
++
+ /* Push empty attributes to the end and inlinedata to the front. */
+ static int attr_compare(const void *a, const void *b)
+ {
+ const struct ext2_xattr *xa = a, *xb = b;
++ char *xa_suffix, *xb_suffix;
++ int xa_idx, xb_idx;
++ int cmp;
+
+ if (xa->name == NULL)
+ return +1;
+@@ -267,7 +272,24 @@ static int attr_compare(const void *a, const void *b)
+ return -1;
+ else if (!strcmp(xb->name, "system.data"))
+ return +1;
+- return 0;
++
++ /*
++ * Duplicate the kernel's sorting algorithm because xattr blocks
++ * require sorted keys.
++ */
++ xa_suffix = xa->name;
++ xb_suffix = xb->name;
++ xa_idx = xb_idx = 0;
++ find_ea_index(xa->name, &xa_suffix, &xa_idx);
++ find_ea_index(xb->name, &xb_suffix, &xb_idx);
++ cmp = xa_idx - xb_idx;
++ if (cmp)
++ return cmp;
++ cmp = strlen(xa_suffix) - strlen(xb_suffix);
++ if (cmp)
++ return cmp;
++ cmp = strcmp(xa_suffix, xb_suffix);
++ return cmp;
+ }
+
+ static const char *find_ea_prefix(int index)
+diff --git a/tests/d_xattr_sorting/expect b/tests/d_xattr_sorting/expect
+new file mode 100644
+index 0000000..17da663
+--- /dev/null
++++ b/tests/d_xattr_sorting/expect
+@@ -0,0 +1,29 @@
++debugfs sort extended attributes
++mke2fs -Fq -b 1024 test.img 512
++Exit status is 0
++ea_set / security.SMEG64 -f /tmp/b
++Exit status is 0
++ea_set / security.imb -f /tmp/b
++Exit status is 0
++ea_set / user.moo cow
++Exit status is 0
++ea_list /
++Extended attributes:
++ user.moo = "cow" (3)
++ security.imb = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" (256)
++ security.SMEG64 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" (256)
++Exit status is 0
++ea_get / security.imb
++xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
++Exit status is 0
++ea_get / nosuchea
++ea_get: Extended attribute key not found while getting extended attribute
++Exit status is 0
++e2fsck -yf -N test_filesys
++Pass 1: Checking inodes, blocks, and sizes
++Pass 2: Checking directory structure
++Pass 3: Checking directory connectivity
++Pass 4: Checking reference counts
++Pass 5: Checking group summary information
++test_filesys: 11/64 files (0.0% non-contiguous), 29/512 blocks
++Exit status is 0
+diff --git a/tests/d_xattr_sorting/name b/tests/d_xattr_sorting/name
+new file mode 100644
+index 0000000..dde8926
+--- /dev/null
++++ b/tests/d_xattr_sorting/name
+@@ -0,0 +1 @@
++sort extended attributes in debugfs
+diff --git a/tests/d_xattr_sorting/script b/tests/d_xattr_sorting/script
+new file mode 100644
+index 0000000..30c189a
+--- /dev/null
++++ b/tests/d_xattr_sorting/script
+@@ -0,0 +1,86 @@
++if test -x $DEBUGFS_EXE; then
++
++OUT=$test_name.log
++EXP=$test_dir/expect
++VERIFY_FSCK_OPT=-yf
++
++TEST_DATA=$test_name.tmp
++VERIFY_DATA=$test_name.ver.tmp
++
++echo "debugfs sort extended attributes" > $OUT
++
++dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
++
++echo "mke2fs -Fq -b 1024 test.img 512" >> $OUT
++
++$MKE2FS -Fq $TMPFILE 512 > /dev/null 2>&1
++status=$?
++echo Exit status is $status >> $OUT
++
++perl -e 'print "x" x 256;' > /tmp/b
++
++echo "ea_set / security.SMEG64 -f /tmp/b" > $OUT.new
++$DEBUGFS -w -R "ea_set / security.SMEG64 -f /tmp/b" $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++echo "ea_set / security.imb -f /tmp/b" > $OUT.new
++$DEBUGFS -w -R "ea_set / security.imb -f /tmp/b" $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++echo "ea_set / user.moo cow" > $OUT.new
++$DEBUGFS -w -R "ea_set / user.moo cow" $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++rm -rf /tmp/b
++
++echo "ea_list /" > $OUT.new
++$DEBUGFS -w -R "ea_list /" $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++echo "ea_get / security.imb" > $OUT.new
++$DEBUGFS -w -R "ea_get / security.imb" $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++echo "ea_get / nosuchea" > $OUT.new
++$DEBUGFS -w -R "ea_get / nosuchea" $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
++$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
++status=$?
++echo Exit status is $status >> $OUT.new
++sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
++
++#
++# Do the verification
++#
++
++rm -f $TMPFILE $OUT.new
++cmp -s $OUT $EXP
++status=$?
++
++if [ "$status" = 0 ] ; then
++ echo "$test_name: $test_description: ok"
++ touch $test_name.ok
++else
++ echo "$test_name: $test_description: failed"
++ diff $DIFF_OPTS $EXP $OUT > $test_name.failed
++fi
++
++unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA
++
++else #if test -x $DEBUGFS_EXE; then
++ echo "$test_name: $test_description: skipped"
++fi
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_git.bb
new file mode 100644
index 000000000..9cde8e46b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_git.bb
@@ -0,0 +1,111 @@
+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://xattr_ordering.patch \
+ file://Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch \
+"
+
+SRCREV = "0f26747167cc9d82df849b0aad387bf824f04544"
+PV = "1.42.99+1.43+git${SRCPV}"
+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}/
+}
+
+# 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-target() {
+ # Clean host path in compile_et, mk_cmds
+ sed -i -e "s,ET_DIR=\"${S}/lib/et\",ET_DIR=\"${datadir}/et\",g" ${D}${bindir}/compile_et
+ sed -i -e "s,SS_DIR=\"${S}/lib/ss\",SS_DIR=\"${datadir}/ss\",g" ${D}${bindir}/mk_cmds
+}
+
+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"
+
+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
new file mode 100644
index 000000000..d4e4675ad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff
@@ -0,0 +1,449 @@
+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
new file mode 100644
index 000000000..5baa70900
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff
@@ -0,0 +1,71 @@
+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
new file mode 100644
index 000000000..deba45fa8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elf_begin.c-CVE-2014-9447-fix.patch
@@ -0,0 +1,37 @@
+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
new file mode 100644
index 000000000..b619619ec
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 000000000..0ff353d0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch
@@ -0,0 +1,39 @@
+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
new file mode 100644
index 000000000..0e2869020
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch
@@ -0,0 +1,57 @@
+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
new file mode 100644
index 000000000..bd634b441
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch
@@ -0,0 +1,73 @@
+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/hppa_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff
new file mode 100644
index 000000000..a86b97c68
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff
@@ -0,0 +1,801 @@
+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
new file mode 100644
index 000000000..a5cc01f91
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/i386_dis.h
@@ -0,0 +1,1657 @@
+#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
new file mode 100644
index 000000000..5b621f92f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff
@@ -0,0 +1,309 @@
+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
new file mode 100644
index 000000000..3f81a75b1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff
@@ -0,0 +1,713 @@
+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
new file mode 100644
index 000000000..2b5dad368
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch
@@ -0,0 +1,27 @@
+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
new file mode 100644
index 000000000..b8a912c41
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff
@@ -0,0 +1,756 @@
+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
new file mode 100644
index 000000000..cd398549d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff
@@ -0,0 +1,1709 @@
+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
new file mode 100644
index 000000000..6a1979148
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch
@@ -0,0 +1,154 @@
+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
new file mode 100644
index 000000000..d792d5fd7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff
@@ -0,0 +1,21 @@
+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
new file mode 100644
index 000000000..3cf16ac92
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support-for-elfutils-0.148.patch
@@ -0,0 +1,91 @@
+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
new file mode 100644
index 000000000..a0198bed9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.148/x86_64_dis.h
@@ -0,0 +1,1632 @@
+#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.164/0001-Ignore-differences-between-mips-machine-identifiers.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-Ignore-differences-between-mips-machine-identifiers.patch
new file mode 100644
index 000000000..3f110f98f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-Ignore-differences-between-mips-machine-identifiers.patch
@@ -0,0 +1,34 @@
+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.164/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch
new file mode 100644
index 000000000..c8d1c8990
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch
@@ -0,0 +1,1163 @@
+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.164/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/Makefile.am
++++ elfutils-0.164/Makefile.am
+@@ -24,7 +24,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.164/lib/color.c
+===================================================================
+--- elfutils-0.164.orig/lib/color.c
++++ elfutils-0.164/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.164/lib/crc32_file.c
+===================================================================
+--- elfutils-0.164.orig/lib/crc32_file.c
++++ elfutils-0.164/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.164/lib/fixedsizehash.h
+===================================================================
+--- elfutils-0.164.orig/lib/fixedsizehash.h
++++ elfutils-0.164/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.164/lib/system.h
+===================================================================
+--- elfutils-0.164.orig/lib/system.h
++++ elfutils-0.164/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.164/lib/xmalloc.c
+===================================================================
+--- elfutils-0.164.orig/lib/xmalloc.c
++++ elfutils-0.164/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.164/libasm/asm_end.c
+===================================================================
+--- elfutils-0.164.orig/libasm/asm_end.c
++++ elfutils-0.164/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.164/libasm/asm_newscn.c
+===================================================================
+--- elfutils-0.164.orig/libasm/asm_newscn.c
++++ elfutils-0.164/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.164/libcpu/i386_gendis.c
+===================================================================
+--- elfutils-0.164.orig/libcpu/i386_gendis.c
++++ elfutils-0.164/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.164/libcpu/i386_lex.c
+===================================================================
+--- elfutils-0.164.orig/libcpu/i386_lex.c
++++ elfutils-0.164/libcpu/i386_lex.c
+@@ -571,7 +571,7 @@ char *i386_text;
+ #endif
+
+ #include <ctype.h>
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+
+ #include <system.h>
+Index: elfutils-0.164/libcpu/i386_parse.c
+===================================================================
+--- elfutils-0.164.orig/libcpu/i386_parse.c
++++ elfutils-0.164/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.164/libdw/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/libdw/Makefile.am
++++ elfutils-0.164/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 $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS)
++ -ldl $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS) -lfts -largp
+ @$(textrel_check)
+ $(AM_V_at)ln -fs $@ $@.$(VERSION)
+
+Index: elfutils-0.164/libdw/libdw_alloc.c
+===================================================================
+--- elfutils-0.164.orig/libdw/libdw_alloc.c
++++ elfutils-0.164/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.164/libdwfl/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/libdwfl/Makefile.am
++++ elfutils-0.164/libdwfl/Makefile.am
+@@ -86,6 +86,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.164/libdwfl/dwfl_build_id_find_elf.c
+===================================================================
+--- elfutils-0.164.orig/libdwfl/dwfl_build_id_find_elf.c
++++ elfutils-0.164/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.164/libdwfl/dwfl_error.c
+===================================================================
+--- elfutils-0.164.orig/libdwfl/dwfl_error.c
++++ elfutils-0.164/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.164/libdwfl/dwfl_module_getdwarf.c
+===================================================================
+--- elfutils-0.164.orig/libdwfl/dwfl_module_getdwarf.c
++++ elfutils-0.164/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.164/libdwfl/find-debuginfo.c
+===================================================================
+--- elfutils-0.164.orig/libdwfl/find-debuginfo.c
++++ elfutils-0.164/libdwfl/find-debuginfo.c
+@@ -372,7 +372,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.164/libdwfl/libdwfl_crc32_file.c
+===================================================================
+--- elfutils-0.164.orig/libdwfl/libdwfl_crc32_file.c
++++ elfutils-0.164/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.164/libdwfl/linux-kernel-modules.c
+===================================================================
+--- elfutils-0.164.orig/libdwfl/linux-kernel-modules.c
++++ elfutils-0.164/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.164/libebl/eblopenbackend.c
+===================================================================
+--- elfutils-0.164.orig/libebl/eblopenbackend.c
++++ elfutils-0.164/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.164/libebl/eblwstrtab.c
+===================================================================
+--- elfutils-0.164.orig/libebl/eblwstrtab.c
++++ elfutils-0.164/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.164/libelf/elf.h
+===================================================================
+--- elfutils-0.164.orig/libelf/elf.h
++++ elfutils-0.164/libelf/elf.h
+@@ -21,7 +21,9 @@
+
+ #include <features.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /* Standard ELF types. */
+
+@@ -3552,7 +3554,8 @@ enum
+
+ #define R_TILEGX_NUM 130
+
+-
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* elf.h */
+Index: elfutils-0.164/libelf/libelf.h
+===================================================================
+--- elfutils-0.164.orig/libelf/libelf.h
++++ elfutils-0.164/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.164/libelf/libelfP.h
+===================================================================
+--- elfutils-0.164.orig/libelf/libelfP.h
++++ elfutils-0.164/libelf/libelfP.h
+@@ -36,6 +36,7 @@
+
+ #include <ar.h>
+ #include <gelf.h>
++#include <libelf.h>
+
+ #include <errno.h>
+ #include <stdint.h>
+Index: elfutils-0.164/src/addr2line.c
+===================================================================
+--- elfutils-0.164.orig/src/addr2line.c
++++ elfutils-0.164/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.164/src/ar.c
+===================================================================
+--- elfutils-0.164.orig/src/ar.c
++++ elfutils-0.164/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.164/src/arlib.c
+===================================================================
+--- elfutils-0.164.orig/src/arlib.c
++++ elfutils-0.164/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.164/src/arlib2.c
+===================================================================
+--- elfutils-0.164.orig/src/arlib2.c
++++ elfutils-0.164/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.164/src/elfcmp.c
+===================================================================
+--- elfutils-0.164.orig/src/elfcmp.c
++++ elfutils-0.164/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.164/src/elflint.c
+===================================================================
+--- elfutils-0.164.orig/src/elflint.c
++++ elfutils-0.164/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.164/src/findtextrel.c
+===================================================================
+--- elfutils-0.164.orig/src/findtextrel.c
++++ elfutils-0.164/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.164/src/i386_ld.c
+===================================================================
+--- elfutils-0.164.orig/src/i386_ld.c
++++ elfutils-0.164/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.164/src/ld.c
+===================================================================
+--- elfutils-0.164.orig/src/ld.c
++++ elfutils-0.164/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.164/src/ldgeneric.c
+===================================================================
+--- elfutils-0.164.orig/src/ldgeneric.c
++++ elfutils-0.164/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.164/src/ldlex.c
+===================================================================
+--- elfutils-0.164.orig/src/ldlex.c
++++ elfutils-0.164/src/ldlex.c
+@@ -1099,7 +1099,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.164/src/ldscript.c
+===================================================================
+--- elfutils-0.164.orig/src/ldscript.c
++++ elfutils-0.164/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.164/src/nm.c
+===================================================================
+--- elfutils-0.164.orig/src/nm.c
++++ elfutils-0.164/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.164/src/objdump.c
+===================================================================
+--- elfutils-0.164.orig/src/objdump.c
++++ elfutils-0.164/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.164/src/ranlib.c
+===================================================================
+--- elfutils-0.164.orig/src/ranlib.c
++++ elfutils-0.164/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.164/src/readelf.c
+===================================================================
+--- elfutils-0.164.orig/src/readelf.c
++++ elfutils-0.164/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.164/src/size.c
+===================================================================
+--- elfutils-0.164.orig/src/size.c
++++ elfutils-0.164/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.164/src/stack.c
+===================================================================
+--- elfutils-0.164.orig/src/stack.c
++++ elfutils-0.164/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.164/src/strings.c
+===================================================================
+--- elfutils-0.164.orig/src/strings.c
++++ elfutils-0.164/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.164/src/strip.c
+===================================================================
+--- elfutils-0.164.orig/src/strip.c
++++ elfutils-0.164/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.164/src/unstrip.c
+===================================================================
+--- elfutils-0.164.orig/src/unstrip.c
++++ elfutils-0.164/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.164/tests/addrscopes.c
+===================================================================
+--- elfutils-0.164.orig/tests/addrscopes.c
++++ elfutils-0.164/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.164/tests/allregs.c
+===================================================================
+--- elfutils-0.164.orig/tests/allregs.c
++++ elfutils-0.164/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.164/tests/backtrace-data.c
+===================================================================
+--- elfutils-0.164.orig/tests/backtrace-data.c
++++ elfutils-0.164/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.164/tests/backtrace-dwarf.c
+===================================================================
+--- elfutils-0.164.orig/tests/backtrace-dwarf.c
++++ elfutils-0.164/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.164/tests/backtrace.c
+===================================================================
+--- elfutils-0.164.orig/tests/backtrace.c
++++ elfutils-0.164/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.164/tests/buildid.c
+===================================================================
+--- elfutils-0.164.orig/tests/buildid.c
++++ elfutils-0.164/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.164/tests/debugaltlink.c
+===================================================================
+--- elfutils-0.164.orig/tests/debugaltlink.c
++++ elfutils-0.164/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.164/tests/debuglink.c
+===================================================================
+--- elfutils-0.164.orig/tests/debuglink.c
++++ elfutils-0.164/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.164/tests/deleted.c
+===================================================================
+--- elfutils-0.164.orig/tests/deleted.c
++++ elfutils-0.164/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.164/tests/dwfl-addr-sect.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwfl-addr-sect.c
++++ elfutils-0.164/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.164/tests/dwfl-bug-addr-overflow.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwfl-bug-addr-overflow.c
++++ elfutils-0.164/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.164/tests/dwfl-bug-fd-leak.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwfl-bug-fd-leak.c
++++ elfutils-0.164/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>
+ #include <sys/resource.h>
+Index: elfutils-0.164/tests/dwfl-bug-getmodules.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwfl-bug-getmodules.c
++++ elfutils-0.164/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.164/tests/dwfl-report-elf-align.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwfl-report-elf-align.c
++++ elfutils-0.164/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.164/tests/dwfllines.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwfllines.c
++++ elfutils-0.164/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.164/tests/dwflmodtest.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwflmodtest.c
++++ elfutils-0.164/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.164/tests/dwflsyms.c
+===================================================================
+--- elfutils-0.164.orig/tests/dwflsyms.c
++++ elfutils-0.164/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.164/tests/early-offscn.c
+===================================================================
+--- elfutils-0.164.orig/tests/early-offscn.c
++++ elfutils-0.164/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.164/tests/ecp.c
+===================================================================
+--- elfutils-0.164.orig/tests/ecp.c
++++ elfutils-0.164/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.164/tests/find-prologues.c
+===================================================================
+--- elfutils-0.164.orig/tests/find-prologues.c
++++ elfutils-0.164/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.164/tests/funcretval.c
+===================================================================
+--- elfutils-0.164.orig/tests/funcretval.c
++++ elfutils-0.164/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.164/tests/funcscopes.c
+===================================================================
+--- elfutils-0.164.orig/tests/funcscopes.c
++++ elfutils-0.164/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.164/tests/getsrc_die.c
+===================================================================
+--- elfutils-0.164.orig/tests/getsrc_die.c
++++ elfutils-0.164/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.164/tests/line2addr.c
+===================================================================
+--- elfutils-0.164.orig/tests/line2addr.c
++++ elfutils-0.164/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.164/tests/low_high_pc.c
+===================================================================
+--- elfutils-0.164.orig/tests/low_high_pc.c
++++ elfutils-0.164/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.164/tests/md5-sha1-test.c
+===================================================================
+--- elfutils-0.164.orig/tests/md5-sha1-test.c
++++ elfutils-0.164/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.164/tests/rdwrmmap.c
+===================================================================
+--- elfutils-0.164.orig/tests/rdwrmmap.c
++++ elfutils-0.164/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.164/tests/saridx.c
+===================================================================
+--- elfutils-0.164.orig/tests/saridx.c
++++ elfutils-0.164/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.164/tests/sectiondump.c
+===================================================================
+--- elfutils-0.164.orig/tests/sectiondump.c
++++ elfutils-0.164/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.164/tests/varlocs.c
+===================================================================
+--- elfutils-0.164.orig/tests/varlocs.c
++++ elfutils-0.164/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.164/tests/vdsosyms.c
+===================================================================
+--- elfutils-0.164.orig/tests/vdsosyms.c
++++ elfutils-0.164/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.164/libelf/elf_getarsym.c
+===================================================================
+--- elfutils-0.164.orig/libelf/elf_getarsym.c
++++ elfutils-0.164/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.164/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch
new file mode 100644
index 000000000..3754c1c36
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch
@@ -0,0 +1,35 @@
+From 668accf322fd7185e273bfd50b84320e71d9de5a Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 10 Apr 2015 00:29:18 +0200
+Subject: [PATCH] elf_getarsym: Silence -Werror=maybe-uninitialized false
+ positive
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ libelf/elf_getarsym.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/libelf/elf_getarsym.c b/libelf/elf_getarsym.c
+index d0bb28a..08954d2 100644
+--- a/libelf/elf_getarsym.c
++++ b/libelf/elf_getarsym.c
+@@ -165,8 +165,13 @@ elf_getarsym (elf, ptr)
+ int w = index64_p ? 8 : 4;
+
+ /* We have an archive. The first word in there is the number of
+- entries in the table. */
+- uint64_t n;
++ entries in the table.
++ Set to SIZE_MAX just to silence -Werror=maybe-uninitialized
++ elf_getarsym.c:290:9: error: 'n' may be used uninitialized in this function
++ The read_number_entries function doesn't initialize n only when returning
++ -1 which in turn ensures to jump over usage of this uninitialized variable.
++ */
++ uint64_t n = SIZE_MAX;
+ size_t off = elf->start_offset + SARMAG + sizeof (struct ar_hdr);
+ if (read_number_entries (&n, elf, &off, index64_p) < 0)
+ {
+--
+2.3.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-fix-a-stack-usage-warning.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-fix-a-stack-usage-warning.patch
new file mode 100644
index 000000000..6923bf705
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-fix-a-stack-usage-warning.patch
@@ -0,0 +1,28 @@
+[PATCH] fix a stack-usage warning
+
+Upstream-Status: Pending
+
+not use a variable to as a array size, otherwise the warning to error that
+stack usage might be unbounded [-Werror=stack-usage=] will happen
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ backends/ppc_initreg.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/backends/ppc_initreg.c b/backends/ppc_initreg.c
+index 64f5379..52dde3e 100644
+--- a/backends/ppc_initreg.c
++++ b/backends/ppc_initreg.c
+@@ -93,7 +93,7 @@ ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
+ return false;
+ }
+ const size_t gprs = sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr);
+- Dwarf_Word dwarf_regs[gprs];
++ Dwarf_Word dwarf_regs[sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr)];
+ for (unsigned gpr = 0; gpr < gprs; gpr++)
+ dwarf_regs[gpr] = user_regs.r.gpr[gpr];
+ if (! setfunc (0, gprs, dwarf_regs, arg))
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-remove-the-unneed-checking.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-remove-the-unneed-checking.patch
new file mode 100644
index 000000000..5be92d705
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0001-remove-the-unneed-checking.patch
@@ -0,0 +1,38 @@
+Disable the test to convert euc-jp
+
+Remove the test "Test against HP-UX 11.11 bug:
+No converter from EUC-JP to UTF-8 is provided"
+since we don't support HP-UX and if the euc-jp is not
+installed on the host, the dependence will be built without
+iconv support and will cause guild-native building fail.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ m4/iconv.m4 | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/m4/iconv.m4 b/m4/iconv.m4
+index a503646..299f1eb 100644
+--- a/m4/iconv.m4
++++ b/m4/iconv.m4
+@@ -159,6 +159,7 @@ int main ()
+ }
+ }
+ #endif
++#if 0
+ /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+ provided. */
+ if (/* Try standardized names. */
+@@ -170,6 +171,7 @@ int main ()
+ /* Try HP-UX names. */
+ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+ result |= 16;
++#endif
+ return result;
+ }]])],
+ [am_cv_func_iconv_works=yes],
+--
+2.0.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch
new file mode 100644
index 000000000..72125c9ff
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch
@@ -0,0 +1,168 @@
+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.164/0003-Add-mips-n64-relocation-format-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0003-Add-mips-n64-relocation-format-hack.patch
new file mode 100644
index 000000000..14b7985ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/0003-Add-mips-n64-relocation-format-hack.patch
@@ -0,0 +1,226 @@
+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.164/aarch64_uio.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/aarch64_uio.patch
new file mode 100644
index 000000000..38dc57bef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/aarch64_uio.patch
@@ -0,0 +1,47 @@
+Fix build on aarch64/musl
+
+Errors
+
+invalid operands to binary & (have 'long double' and 'unsigned int')
+
+error: redefinition
+ of 'struct iovec'
+ struct iovec { void *iov_base; size_t iov_len; };
+ ^
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: elfutils-0.163/backends/aarch64_initreg.c
+===================================================================
+--- elfutils-0.163.orig/backends/aarch64_initreg.c
++++ elfutils-0.163/backends/aarch64_initreg.c
+@@ -33,7 +33,7 @@
+ #include "system.h"
+ #include <assert.h>
+ #ifdef __aarch64__
+-# include <linux/uio.h>
++# include <sys/uio.h>
+ # include <sys/user.h>
+ # include <sys/ptrace.h>
+ /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
+@@ -82,7 +82,7 @@ aarch64_set_initial_registers_tid (pid_t
+
+ Dwarf_Word dwarf_fregs[32];
+ for (int r = 0; r < 32; r++)
+- dwarf_fregs[r] = fregs.vregs[r] & 0xFFFFFFFF;
++ dwarf_fregs[r] = (unsigned int)fregs.vregs[r] & 0xFFFFFFFF;
+
+ if (! setfunc (64, 32, dwarf_fregs, arg))
+ return false;
+Index: elfutils-0.163/backends/arm_initreg.c
+===================================================================
+--- elfutils-0.163.orig/backends/arm_initreg.c
++++ elfutils-0.163/backends/arm_initreg.c
+@@ -37,7 +37,7 @@
+ #endif
+
+ #ifdef __aarch64__
+-# include <linux/uio.h>
++# include <sys/uio.h>
+ # include <sys/user.h>
+ # include <sys/ptrace.h>
+ /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/arm_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/arm_backend.diff
new file mode 100644
index 000000000..9d47f95f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/arm_backend.diff
@@ -0,0 +1,600 @@
+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.164/fixheadercheck.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/fixheadercheck.patch
new file mode 100644
index 000000000..5de3b24c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/fixheadercheck.patch
@@ -0,0 +1,23 @@
+For some binaries we can get a invalid section alignment, for example if
+sh_align = 1 and sh_addralign is 0. In the case of a zero size section like
+".note.GNU-stack", this is irrelavent as far as I can tell and we shouldn't
+error in this case.
+
+RP 2014/6/11
+
+Upstream-Status: Pending
+
+diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
+--- a/libelf/elf32_updatenull.c
++++ b/libelf/elf32_updatenull.c
+@@ -339,8 +339,8 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
+ we test for the alignment of the section being large
+ enough for the largest alignment required by a data
+ block. */
+- if (unlikely (! powerof2 (shdr->sh_addralign))
+- || unlikely ((shdr->sh_addralign ?: 1) < sh_align))
++ if (shdr->sh_size && (unlikely (! powerof2 (shdr->sh_addralign))
++ || unlikely ((shdr->sh_addralign ?: 1) < sh_align)))
+ {
+ __libelf_seterrno (ELF_E_INVALID_ALIGN);
+ return -1;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/hppa_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/hppa_backend.diff
new file mode 100644
index 000000000..45456715a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/hppa_backend.diff
@@ -0,0 +1,799 @@
+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.164/kfreebsd_path.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/kfreebsd_path.patch
new file mode 100644
index 000000000..ba454ee77
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/kfreebsd_path.patch
@@ -0,0 +1,15 @@
+--- 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.164/m68k_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/m68k_backend.diff
new file mode 100644
index 000000000..d73855b60
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/m68k_backend.diff
@@ -0,0 +1,492 @@
+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.164/mips_backend.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_backend.diff
new file mode 100644
index 000000000..de1237be0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_backend.diff
@@ -0,0 +1,711 @@
+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.164/mips_readelf_w.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_readelf_w.patch
new file mode 100644
index 000000000..930d6f664
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/mips_readelf_w.patch
@@ -0,0 +1,22 @@
+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.164/shadow.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/shadow.patch
new file mode 100644
index 000000000..d31961f94
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/shadow.patch
@@ -0,0 +1,23 @@
+Fix control path where we have str as uninitialized string
+
+| /home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c: In function 'i386_disasm':
+| /home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:310:5: error: 'str' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+| memcpy (buf + bufcnt, _str, _len); \
+| ^
+| /home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:709:17: note: 'str' was declared here
+| const char *str;
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: elfutils-0.164/libcpu/i386_disasm.c
+===================================================================
+--- elfutils-0.164.orig/libcpu/i386_disasm.c
++++ elfutils-0.164/libcpu/i386_disasm.c
+@@ -821,6 +821,7 @@ i386_disasm (const uint8_t **startp, con
+ }
+
+ default:
++ str = "";
+ assert (! "INVALID not handled");
+ }
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/testsuite-ignore-elflint.diff b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/testsuite-ignore-elflint.diff
new file mode 100644
index 000000000..eae5796de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/testsuite-ignore-elflint.diff
@@ -0,0 +1,39 @@
+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.164/uclibc-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/uclibc-support.patch
new file mode 100644
index 000000000..966b70fcc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.164/uclibc-support.patch
@@ -0,0 +1,129 @@
+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.164/configure.ac
+===================================================================
+--- elfutils-0.164.orig/configure.ac
++++ elfutils-0.164/configure.ac
+@@ -66,6 +66,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
+@@ -291,18 +299,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.164/libcpu/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/libcpu/Makefile.am
++++ elfutils-0.164/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.164/libdw/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/libdw/Makefile.am
++++ elfutils-0.164/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 $(argp_LDADD) $(zip_LIBS)
++ -ldl $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS)
+ @$(textrel_check)
+ $(AM_V_at)ln -fs $@ $@.$(VERSION)
+
+Index: elfutils-0.164/libelf/Makefile.am
+===================================================================
+--- elfutils-0.164.orig/libelf/Makefile.am
++++ elfutils-0.164/libelf/Makefile.am
+@@ -93,7 +93,12 @@ libelf_a_SOURCES = elf_version.c elf_has
+ libelf_pic_a_SOURCES =
+ am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
+
++
+ libelf_so_LDLIBS =
++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/Fix_elf_cvt_gunhash.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch
new file mode 100644
index 000000000..f861e8990
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch
@@ -0,0 +1,29 @@
+Fix elf_cvt_gunhash if dest and src are same.
+
+Upstream-Status: Pending
+
+The 'dest' and 'src' can be same, we need to save the value of src32[2]
+before swaping it.
+
+Signed-off-by: Baoshan Pang <BaoShan.Pang@windriver.com>
+diff --git a/libelf/gnuhash_xlate.h b/libelf/gnuhash_xlate.h
+index 6faf113..04d9ca1 100644
+--- a/libelf/gnuhash_xlate.h
++++ b/libelf/gnuhash_xlate.h
+@@ -40,6 +40,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode)
+ words. We must detangle them here. */
+ Elf32_Word *dest32 = dest;
+ const Elf32_Word *src32 = src;
++ Elf32_Word save_src32_2 = src32[2]; // dest could be equal to src
+
+ /* First four control words, 32 bits. */
+ for (unsigned int cnt = 0; cnt < 4; ++cnt)
+@@ -50,7 +51,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode)
+ len -= 4;
+ }
+
+- Elf32_Word bitmask_words = encode ? src32[2] : dest32[2];
++ Elf32_Word bitmask_words = encode ? save_src32_2 : dest32[2];
+
+ /* Now the 64 bit words. */
+ Elf64_Xword *dest64 = (Elf64_Xword *) &dest32[4];
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/dso-link-change.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/dso-link-change.patch
new file mode 100644
index 000000000..d0cd3ed6f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils/dso-link-change.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+
+# This patch makes the link to the dependencies of libdw explicit, as recent
+# ld no longer implicitly links them. See
+# http://lists.fedoraproject.org/pipermail/devel/2010-March/133601.html as
+# a similar example of the error message you can encounter without this patch,
+# and https://fedoraproject.org/wiki/UnderstandingDSOLinkChange and
+# https://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking for more
+# details.
+
+--- elfutils-0.148.orig/src/Makefile.am
++++ elfutils-0.148/src/Makefile.am
+@@ -86,7 +86,7 @@ libdw = ../libdw/libdw.a $(zip_LIBS) $(l
+ libelf = ../libelf/libelf.a
+ else
+ libasm = ../libasm/libasm.so
+-libdw = ../libdw/libdw.so
++libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
+ libelf = ../libelf/libelf.so
+ endif
+ libebl = ../libebl/libebl.a
+--- elfutils-0.148.orig/tests/Makefile.am
++++ elfutils-0.148/tests/Makefile.am
+@@ -172,7 +172,7 @@ libdw = ../libdw/libdw.a $(zip_LIBS) $(l
+ libelf = ../libelf/libelf.a
+ libasm = ../libasm/libasm.a
+ else
+-libdw = ../libdw/libdw.so
++libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
+ libelf = ../libelf/libelf.so
+ libasm = ../libasm/libasm.so
+ endif
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
new file mode 100644
index 000000000..ff5325734
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb
@@ -0,0 +1,90 @@
+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 = "https://fedorahosted.org/releases/e/l/${BPN}/${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 \
+"
+# 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.164.bb b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.164.bb
new file mode 100644
index 000000000..4964c0507
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.164.bb
@@ -0,0 +1,89 @@
+SUMMARY = "Utilities and libraries for handling compiled object files"
+HOMEPAGE = "https://fedorahosted.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://fedorahosted.org/releases/e/l/elfutils/${PV}/${BP}.tar.bz2"
+
+SRC_URI[md5sum] = "2e4536c1c48034f188a80789a59114d8"
+SRC_URI[sha256sum] = "9683c025928a12d06b7fe812928aa6235249e22d197d086f7084606a48165900"
+
+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://shadow.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 \
+"
+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-configure.in.patch b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-configure.in.patch
new file mode 100644
index 000000000..7595a254a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-configure.in.patch
@@ -0,0 +1,108 @@
+Allow cross compiling.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/configure.in b/configure.in
+--- a/configure.in 2012-12-14 15:31:32.623180450 +0100
++++ b/configure.in 2012-12-14 15:53:34.518233519 +0100
+@@ -481,7 +481,7 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_MSG_RESULT(no)
+ )
+
+ AC_MSG_CHECKING([if any value exists for WNOHANG])
+@@ -506,7 +506,9 @@
+ AC_MSG_RESULT(no)
+ AC_DEFINE(WNOHANG_BACKUP_VALUE, 1)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_MSG_RESULT(yes)
++ AC_DEFINE_UNQUOTED(WNOHANG_BACKUP_VALUE, `cat wnohang`)
++ rm -f wnohang
+ )
+
+ #
+@@ -574,7 +576,8 @@
+ AC_DEFINE(REARM_SIG)
+ ,
+ AC_MSG_RESULT(no)
+-, AC_MSG_WARN([Expect can't be cross compiled])
++,
++ AC_MSG_RESULT(no)
+ )
+
+ # HPUX7 has trouble with the big cat so split it
+@@ -725,7 +728,9 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_MSG_RESULT(yes)
++ AC_DEFINE(HAVE_SGTTYB)
++ PTY_TYPE=sgttyb
+ )
+
+ # mach systems have include files for unimplemented features
+@@ -749,7 +754,9 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_DEFINE(HAVE_TERMIO)
++ PTY_TYPE=termios
++ AC_MSG_RESULT(yes)
+ )
+
+ # now check for the new style ttys (not yet posix)
+@@ -771,7 +778,9 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_DEFINE(HAVE_TERMIOS)
++ PTY_TYPE=termios
++ AC_MSG_RESULT(yes)
+ )
+ fi
+
+@@ -794,7 +803,7 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_MSG_RESULT(no)
+ )
+
+ AC_MSG_CHECKING([if TIOCGWINSZ in termios.h])
+@@ -816,7 +825,7 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_MSG_RESULT(no)
+ )
+
+ # finally check for Cray style ttys
+@@ -837,7 +846,7 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_MSG_RESULT(no)
+ )
+
+ #
+@@ -889,7 +898,8 @@
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_DEFINE(HAVE_SV_TIMEZONE)
++ AC_MSG_RESULT(yes),
+ )
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-expect-install-scripts-without-using-the-fixline1-tc.patch b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-expect-install-scripts-without-using-the-fixline1-tc.patch
new file mode 100644
index 000000000..274ad8635
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0001-expect-install-scripts-without-using-the-fixline1-tc.patch
@@ -0,0 +1,34 @@
+Upstream-Status: Inappropriate [wrlinux specific]
+
+Subject: expect: install scripts without using the fixline1 tcl script
+
+On older machines like SLED11.2, we are encountering do_install failures
+complaining that 'GLIBC_2.14' is not found in /lib64/libc.so.6 but is required
+by libtcl8.6.so.0.
+
+This is because that we're executing the fixline1 tcl script which requires
+libtcl8.6.so.0 in sysroot. However, all commands in SCRIPTS already have got
+the correct first line, that is '#!/bin/sh'. We don't need to modify anything.
+That's why we could just copy them.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index c05c880..f1394ff 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -380,7 +380,7 @@ dist: dist-clean doc
+ cp $(DIST_ROOT)/$(PKG_DIR).tar.gz $(top_builddir)
+
+ $(SCRIPTS):
+- $(TCLSH) $(srcdir)/fixline1 $(SHORT_BINDIR) < $(srcdir)/example/$@ > $@
++ cp $(srcdir)/example/$@ $@
+
+ ## We cannot use TCL_LIBS below (after TCL_LIB_SPEC) because its
+ ## expansion references the contents of LIBS, which contains linker
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch
new file mode 100644
index 000000000..dc4c6ba40
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch
@@ -0,0 +1,17 @@
+Use proper -L path when cross compiling.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/tclconfig/tcl.m4 b/tclconfig/tcl.m4
+--- a/tclconfig/tcl.m4 2012-12-14 09:16:58.789861281 +0100
++++ b/tclconfig/tcl.m4 2012-12-14 10:55:43.542297010 +0100
+@@ -371,7 +371,7 @@
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+- if test -f "${TCL_BIN_DIR}/Makefile" ; then
++ if test -f "${TCL_BIN_DIR}/Makefile" || test "$cross_compiling" = yes; then
+ TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
+ TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
+ TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/01-example-shebang.patch b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/01-example-shebang.patch
new file mode 100644
index 000000000..8597f3138
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect/01-example-shebang.patch
@@ -0,0 +1,144 @@
+Author: Mike Markley <mike@markley.org>
+Author: Sergei Golovan <sgolovan@debian.org>
+Description: Fixes shebangs in examples (Closes: #152367).
+
+Backported from Debian
+
+Upstream-Status: Pending
+Index: expect5.45/example/beer.exp
+===================================================================
+--- expect5.45.orig/example/beer.exp 2006-01-25 13:51:39.000000000 -0800
++++ expect5.45/example/beer.exp 2013-11-01 17:35:19.817318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect -f
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+
+ # 99 bottles of beer on the wall, Expect-style
+ # Author: Don Libes <libes@nist.gov>
+Index: expect5.45/example/expectd.proto
+===================================================================
+--- expect5.45.orig/example/expectd.proto 2010-07-02 09:03:31.000000000 -0700
++++ expect5.45/example/expectd.proto 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,10 @@
+-#!/depot/tcl/src/expect/e --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
++
+ # Description: Simple fragment to begin a telnet daemon
+ # For more information, see Chapter 17 of "Exploring Expect"
+ # Author: Don Libes, NIST
+Index: expect5.45/example/irsh
+===================================================================
+--- expect5.45.orig/example/irsh 2010-07-02 09:03:31.000000000 -0700
++++ expect5.45/example/irsh 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+
+ # Do rsh interactively. For example, consider the following command:
+ # rsh <remote> ls -l "|" more
+Index: expect5.45/example/passwd.cgi
+===================================================================
+--- expect5.45.orig/example/passwd.cgi 2000-01-06 15:22:07.000000000 -0800
++++ expect5.45/example/passwd.cgi 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+
+ # This is a CGI script to process requests created by the accompanying
+ # passwd.html form. This script is pretty basic, although it is
+Index: expect5.45/example/passwdprompt
+===================================================================
+--- expect5.45.orig/example/passwdprompt 2003-09-05 12:01:59.000000000 -0700
++++ expect5.45/example/passwdprompt 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+
+ # This script prompts for a passwd from stdin while echoing *'s
+
+Index: expect5.45/example/reprompt
+===================================================================
+--- expect5.45.orig/example/reprompt 2000-01-06 15:22:07.000000000 -0800
++++ expect5.45/example/reprompt 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+
+ # Name: reprompt
+ # Description: reprompt every so often until user enters something
+Index: expect5.45/example/term_expect
+===================================================================
+--- expect5.45.orig/example/term_expect 2005-02-15 10:11:31.000000000 -0800
++++ expect5.45/example/term_expect 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expectk
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec wish "$0" ${1+"$@"}
++
++package require Expect
+
+ # Name: tkterm - terminal emulator using Expect and Tk text widget, v3.0
+ # Author: Don Libes, July '94
+Index: expect5.45/example/vrfy
+===================================================================
+--- expect5.45.orig/example/vrfy 2010-07-02 09:03:31.000000000 -0700
++++ expect5.45/example/vrfy 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect -f
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+
+
+ # separate address into user and host
+Index: expect5.45/example/xrlogin
+===================================================================
+--- expect5.45.orig/example/xrlogin 2000-01-06 15:22:08.000000000 -0800
++++ expect5.45/example/xrlogin 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,10 @@
+-#!/depot/path/expect --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
++
+ # xrlogin - rlogin but with current DISPLAY
+ #
+ # You can extend this idea to save any arbitrary information across rlogin
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
new file mode 100644
index 000000000..b4dfe157c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/expect/expect_5.45.bb
@@ -0,0 +1,64 @@
+SUMMARY = "tool for automating interactive applications according to a script"
+DESCRIPTION = "Expect is a tool for automating interactive applications according to a script. \
+Following the script, Expect knows what can be expected from a program and what \
+the correct response should be. Expect is also useful for testing these same \
+applications. And by adding Tk, you can also wrap interactive applications in \
+X11 GUIs. An interpreted language provides branching and high-level control \
+structures to direct the dialogue. In addition, the user can take control and \
+interact directly when desired, afterward returning control to the script. \
+"
+HOMEPAGE = "http://sourceforge.net/projects/expect/"
+LICENSE = "PD"
+SECTION = "devel"
+
+LIC_FILES_CHKSUM = "file://license.terms;md5=fbf2de7e9102505b1439db06fc36ce5c"
+
+DEPENDS += "tcl"
+RDEPENDS_${PN} = "tcl"
+
+inherit autotools
+
+PR = "r1"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/expect/Expect/${PV}/${BPN}${PV}.tar.gz \
+ file://0001-configure.in.patch \
+ file://0002-tcl.m4.patch \
+ file://01-example-shebang.patch \
+ file://0001-expect-install-scripts-without-using-the-fixline1-tc.patch \
+ "
+SRC_URI[md5sum] = "44e1a4f4c877e9ddc5a542dfa7ecc92b"
+SRC_URI[sha256sum] = "b28dca90428a3b30e650525cdc16255d76bb6ccd65d448be53e620d95d5cc040"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/expect/files/Expect/"
+UPSTREAM_CHECK_REGEX = "/Expect/(?P<pver>(\d+[\.\-_]*)+)/"
+
+S = "${WORKDIR}/${BPN}${PV}"
+
+do_install_append() {
+ install -d ${D}${libdir}
+ install -m 0755 ${D}${libdir}/expect${PV}/libexpect*.so ${D}${libdir}/
+ install -m 0755 ${S}/fixline1 ${D}${libdir}/expect${PV}/
+ install -m 0755 ${S}/example/* ${D}${libdir}/expect${PV}/
+ rm ${D}${libdir}/expect${PV}/libexpect*.so
+ sed -e 's|$dir|${libdir}|' -i ${D}${libdir}/expect${PV}/pkgIndex.tcl
+}
+
+EXTRA_OECONF += "--with-tcl=${STAGING_LIBDIR} \
+ --with-tclinclude=${STAGING_INCDIR}/tcl8.6 \
+ --enable-shared \
+ --enable-threads \
+ --disable-rpath \
+ "
+EXTRA_OEMAKE_install = " 'SCRIPTS=' "
+
+FILES_${PN}-dev = "${libdir_native}/expect${PV}/libexpect*.so \
+ ${includedir}/expect.h \
+ ${includedir}/expect_tcl.h \
+ ${includedir}/expect_comm.h \
+ ${includedir}/tcldbg.h \
+ ${includedir}/*.h \
+ "
+
+FILES_${PN} += "${libdir}/libexpect${PV}.so \
+ ${libdir}/expect${PV}/* \
+ "
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
new file mode 100644
index 000000000..8fab28f33
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.1.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Utility for modifying GPT disk partitioning"
+DESCRIPTION = "GPT fdisk is a disk partitioning tool loosely modeled on Linux fdisk, but used for modifying GUID Partition Table (GPT) disks. The related FixParts utility fixes some common problems on Master Boot Record (MBR) disks."
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+DEPENDS = "util-linux popt ncurses"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${PV}/${BP}.tar.gz"
+SRC_URI[md5sum] = "d7f3d306b083123bcc6f5941efade586"
+SRC_URI[sha256sum] = "864c8aee2efdda50346804d7e6230407d5f42a8ae754df70404dd8b2fdfaeac7"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/gptfdisk/files/gptfdisk/"
+UPSTREAM_CHECK_REGEX = "/gptfdisk/(?P<pver>(\d+[\.\-_]*)+)/"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_install() {
+ install -d ${D}${sbindir}
+ install -m 0755 cgdisk ${D}${sbindir}
+ install -m 0755 gdisk ${D}${sbindir}
+ install -m 0755 sgdisk ${D}${sbindir}
+ install -m 0755 fixparts ${D}${sbindir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch b/import-layers/yocto-poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch
new file mode 100644
index 000000000..8a16b2cf7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch
@@ -0,0 +1,39 @@
+From 08abf944b2bff27b6dd325dd15b4861cebef113a Mon Sep 17 00:00:00 2001
+From: Junling Zheng <zhengjunling@huawei.com>
+Date: Wed, 8 Apr 2015 03:26:57 +0000
+Subject: [PATCH] Add -P prompt into Usage info
+
+Currently, Usage info doesn't include -P prompt, add it:
+
+root@arma9el:~# file
+Usage: file [-bcEhikLlNnprsvz0] [--apple] [--mime-encoding] [--mime-type]
+ [-e testname] [-F separator] [-f namefile] [-m magicfiles]
+ [-P parameter=limits] file ...
+ file -C [-m magicfiles]
+ file [--help]
+
+Upstream-Status: Submitted
+
+Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
+---
+ src/file.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/file.c b/src/file.c
+index 2b15e21..e5a957b 100644
+--- a/src/file.c
++++ b/src/file.c
+@@ -76,8 +76,8 @@ int getopt_long(int argc, char * const *argv, const char *optstring, const struc
+ # define USAGE \
+ "Usage: %s [" FILE_FLAGS \
+ "] [--apple] [--extension] [--mime-encoding] [--mime-type]\n" \
+- " [-e testname] [-F separator] [-f namefile] [-m magicfiles] " \
+- "file ...\n" \
++ " [-e testname] [-F separator] [-f namefile] [-m magicfiles]\n " \
++ " [-P parameter=limits] file ...\n" \
+ " %s -C [-m magicfiles]\n" \
+ " %s [--help]\n"
+
+--
+1.8.3.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/file/file/debian-742262.patch b/import-layers/yocto-poky/meta/recipes-devtools/file/file/debian-742262.patch
new file mode 100644
index 000000000..1ef485e93
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/file/file/debian-742262.patch
@@ -0,0 +1,19 @@
+The awk pattern was checked *before* the Perl pattern, so the perl
+script with BEGIN{...} would be reported as awk, this patch fixes it.
+
+Upstream-Status: Backport [debian]
+
+Signed-off-by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+diff --git a/magic/Magdir/commands b/magic/Magdir/commands
+--- a/magic/Magdir/commands
++++ b/magic/Magdir/commands
+@@ -57,6 +57,7 @@
+ 0 string/wt #!\ /usr/bin/awk awk script text executable
+ !:mime text/x-awk
+ 0 regex/4096 =^\\s{0,100}BEGIN\\s{0,100}[{] awk or perl script text
++!:strength - 12
+
+ # AT&T Bell Labs' Plan 9 shell
+ 0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/file/file/host-file.patch b/import-layers/yocto-poky/meta/recipes-devtools/file/file/host-file.patch
new file mode 100644
index 000000000..a7efbdcbc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/file/file/host-file.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Submitted (http://bugs.gw.com/view.php?id=485)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 3cde199d03b39632361c275cd30fa0612a03138b Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Mon, 19 Oct 2015 10:30:57 +0100
+Subject: [PATCH 2/2] When using the host file, respect FILE_COMPILE
+
+If we're cross-compiling and not using the file binary that was just built,
+execute the binary that we've been told to use (via FILE_COMPILE) when checking
+the version instead of assuming that "file" is correct as the actual compile
+uses FILE_COMPILE so different binaries may be used.
+---
+ magic/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/magic/Makefile.am b/magic/Makefile.am
+index 89ac844..67067fe 100644
+--- a/magic/Makefile.am
++++ b/magic/Makefile.am
+@@ -293,7 +293,7 @@ ${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP)
+ @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \
+ echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \
+ else \
+- v=$$(file --version | sed -e s/file-// -e q); \
++ v=$$(${FILE_COMPILE} --version | sed -e s/file-// -e q); \
+ if [ "$$v" != "${PACKAGE_VERSION}" ]; then \
+ echo "Cannot use the installed version of file ($$v) to"; \
+ echo "cross-compile file ${PACKAGE_VERSION}"; \
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.25.bb b/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.25.bb
new file mode 100644
index 000000000..68bad69b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.25.bb
@@ -0,0 +1,47 @@
+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 \
+ file://host-file.patch \
+ "
+
+SRCREV = "f45db89ddc91692b662fffbabbdafc7bc4c00f5e"
+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"
+
+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/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch
new file mode 100644
index 000000000..556c240b2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch
@@ -0,0 +1,28 @@
+From b4aa18d939fc0c8825fa584dfcee1a7da61099cf Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 10 Dec 2015 16:09:26 +0200
+Subject: [PATCH] tests: add a target for building tests without running them
+
+Upstream-Status: Inappropriate [oe specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ tests/Makefile.am | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 4ac3c17..0025cfe 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -21,6 +21,9 @@
+
+ TESTS = $(check_PROGRAMS) options.cn
+
++# This allows building tests without running them
++buildtests: $(TESTS)
++
+ # The script testwrapper.sh will run most tests as is. A couple tests
+ # in the suite end in .reject, .table and the like so that we can pass
+ # different arguments to the test runner. We list those extensions so
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/disable-tests.patch b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/disable-tests.patch
new file mode 100644
index 000000000..4dc801d72
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/disable-tests.patch
@@ -0,0 +1,19 @@
+Due to automake stupidity the Makefile in tests/ has an 'all' target that
+depends on $(BUILD_SOURCES), which means when building flex parts of the test
+suite are built even if they're not needed, resulting in flex needing
+flex-native and bison-native to build.
+
+This patch removes the tests directory from SUBDIRS and will be conditionally
+applied by the recipe.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/Makefile.am b/Makefile.am
+index 076ccad..0574d7b 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -55,3 +55,2 @@ SUBDIRS = \
+ po \
+- tests \
+ tools
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch
new file mode 100644
index 000000000..032833ae7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate (embedded specific)
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+
+Index: flex-2.5.37/doc/Makefile.am
+===================================================================
+--- flex-2.5.37.orig/doc/Makefile.am 2012-07-21 04:18:27.000000000 +0300
++++ flex-2.5.37/doc/Makefile.am 2013-07-30 17:57:09.834834531 +0300
+@@ -2,7 +2,7 @@
+
+ info_TEXINFOS = flex.texi
+ dist_man_MANS = flex.1
+-dist_doc_DATA= flex.pdf
++EXTRA_DIST= flex.pdf
+
+ CLEANFILES = \
+ flex.hks \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/run-ptest
new file mode 100755
index 000000000..19db33790
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# make would want to rebuild some files with a compiler otherwise :-/
+make FLEX=/usr/bin/flex -t check-TESTS || true
+make FLEX=/usr/bin/flex check-TESTS
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/flex/flex_2.6.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex_2.6.0.bb
new file mode 100644
index 000000000..8285426d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/flex/flex_2.6.0.bb
@@ -0,0 +1,55 @@
+SUMMARY = "Flex (The Fast Lexical Analyzer)"
+DESCRIPTION = "Flex is a fast lexical analyser generator. Flex is a tool for generating programs that recognize \
+lexical patterns in text."
+HOMEPAGE = "http://sourceforge.net/projects/flex/"
+SECTION = "devel"
+LICENSE = "BSD"
+
+DEPENDS = "${@bb.utils.contains('PTEST_ENABLED', '1', 'bison-native flex-native', '', d)}"
+BBCLASSEXTEND = "native nativesdk"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e4742cf92e89040b39486a6219b68067"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/flex/flex-${PV}.tar.bz2 \
+ file://run-ptest \
+ file://do_not_create_pdf_doc.patch \
+ file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', '', 'file://disable-tests.patch', d)} \
+ "
+
+SRC_URI[md5sum] = "266270f13c48ed043d95648075084d59"
+SRC_URI[sha256sum] = "24e611ef5a4703a191012f80c1027dc9d12555183ce0ecd46f3636e587e9b8e9"
+
+UPSTREAM_CHECK_REGEX = "flex-(?P<pver>\d+(\.\d+)+)\.tar"
+
+inherit autotools gettext texinfo ptest
+
+M4 = "${bindir}/m4"
+M4_class-native = "${STAGING_BINDIR_NATIVE}/m4"
+EXTRA_OECONF += "ac_cv_path_M4=${M4}"
+EXTRA_OEMAKE += "m4=${STAGING_BINDIR_NATIVE}/m4"
+
+EXTRA_OEMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', 'FLEX=${STAGING_BINDIR_NATIVE}/flex', '', d)}"
+
+do_install_append_class-native() {
+ create_wrapper ${D}/${bindir}/flex M4=${M4}
+}
+
+do_install_append_class-nativesdk() {
+ create_wrapper ${D}/${bindir}/flex M4=${M4}
+}
+
+RDEPENDS_${PN} += "m4"
+RDEPENDS_${PN}-ptest += "bash gawk"
+
+do_compile_ptest() {
+ oe_runmake -C ${B}/tests -f ${B}/tests/Makefile top_builddir=${B} INCLUDES=-I${S}/src buildtests
+}
+
+do_install_ptest() {
+ mkdir -p ${D}${PTEST_PATH}/build-aux/
+ cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
+ cp -r ${S}/tests/* ${D}${PTEST_PATH}
+ cp -r ${B}/tests/* ${D}${PTEST_PATH}
+ sed -e 's/^Makefile:/_Makefile:/' -e 's/^srcdir = \(.*\)/srcdir = ./' -e 's/^top_srcdir = \(.*\)/top_srcdir = ./' -i ${D}${PTEST_PATH}/Makefile
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9.inc
new file mode 100644
index 000000000..7e03f3121
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -0,0 +1,139 @@
+require gcc-common.inc
+
+# Third digit in PV should be incremented after a minor release
+
+PV = "4.9.3"
+
+# BINV should be incremented to a revision after a minor gcc release
+
+BINV = "4.9.3"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.9:"
+
+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 \
+"
+
+SRC_URI = "\
+ ${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
+ 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-c99-complex-ugly-hack.patch \
+ file://0011-index_macro.patch \
+ file://0013-libstdc-namespace.patch \
+ file://0014-sh-pr24836.patch \
+ file://0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch \
+ file://0016-gcc-poison-system-directories.patch \
+ file://0017-gcc-poison-dir-extend.patch \
+ file://0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
+ file://0019-64-bit-multilib-hack.patch \
+ file://0020-optional-libstdc.patch \
+ file://0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
+ file://0022-COLLECT_GCC_OPTIONS.patch \
+ file://0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
+ file://0025-fortran-cross-compile-hack.patch \
+ file://0026-libgcc-sjlj-check.patch \
+ file://0027-cpp-honor-sysroot.patch \
+ file://0028-MIPS64-Default-to-N64-ABI.patch \
+ file://0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
+ file://0030-gcc-Fix-argument-list-too-long-error.patch \
+ file://0031-Disable-sdt.patch \
+ file://0032-libtool.patch \
+ file://0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
+ file://0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
+ file://0040-fix-g++-sysroot.patch \
+ file://0041-libtool-avoid-libdir.patch \
+ file://0043-cpp.patch \
+ file://0044-gengtypes.patch \
+ file://0046-libatomic-deptracking.patch \
+ file://0047-repomembug.patch \
+ file://0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
+ file://0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch \
+ file://0051-eabispe.patch \
+ file://0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch \
+ file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \
+ file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
+ file://0055-dwarf-reg-processing-helper.patch \
+ file://0056-define-default-cfa-register-mapping.patch \
+ file://0057-aarch64-config.patch \
+ file://0058-gcc-r212171.patch \
+ file://0059-gcc-PR-rtl-optimization-63348.patch \
+ file://0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch \
+ file://0061-target-gcc-includedir.patch \
+ file://0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch \
+ file://0063-nativesdk-gcc-support.patch \
+ file://0064-handle-target-sysroot-multilib.patch \
+ file://0065-gcc-483-universal-initializer-no-warning.patch \
+ file://0066-cxxflags-for-build.patch \
+ file://0067-fix-arm-thumb.patch \
+ file://0067-gcc-musl-support.patch \
+ file://0068-musl-dynamic-linker.patch \
+ file://0069-musl-no-fixincludes.patch \
+ file://0070-libstdc-musl.patch \
+ file://0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch \
+ file://0072-support-ffile-prefix-map.patch \
+ file://0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
+ file://0074-fdebug-prefix-map-support-to-remap-relative-path.patch \
+"
+SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327"
+SRC_URI[sha256sum] = "2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e"
+
+UPSTREAM_CHECK_REGEX = "gcc-(?P<pver>4\.9\.\d+).tar"
+
+S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
+
+# Language Overrides
+FORTRAN = ""
+JAVA = ""
+
+LTO = "--enable-lto"
+
+EXTRA_OECONF_BASE = "\
+ ${LTO} \
+ --enable-libssp \
+ --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 \
+"
+
+EXTRA_OECONF_INITIAL = "\
+ --disable-libmudflap \
+ --disable-libgomp \
+ --disable-libssp \
+ --disable-libquadmath \
+ --with-system-zlib \
+ --disable-lto \
+ --disable-plugin \
+ --enable-decimal-float=no \
+"
+
+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-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
new file mode 100644
index 000000000..e58801167
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
@@ -0,0 +1,42 @@
+From bf3d96ae58fa180b8b468d25dc2e0209daca2751 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:37:11 +0400
+Subject: [PATCH 01/35] gcc-4.3.1: ARCH_FLAGS_FOR_TARGET
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ configure | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index d809535..1b76c90 100755
+--- a/configure
++++ b/configure
+@@ -7439,7 +7439,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $target_configargs " in
+diff --git a/configure.ac b/configure.ac
+index 48ec1aa..89d1d3f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2873,7 +2873,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $target_configargs " in
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0002-uclibc-conf.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0002-uclibc-conf.patch
new file mode 100644
index 000000000..dda3b1041
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0002-uclibc-conf.patch
@@ -0,0 +1,53 @@
+From d030973c872c00d916921d84deee0af2c0d38081 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:38:25 +0400
+Subject: [PATCH 02/35] uclibc-conf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ contrib/regression/objs-gcc.sh | 4 ++++
+ libjava/classpath/ltconfig | 4 ++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh
+index 60b0497..6dc7ead 100755
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ]
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+diff --git a/libjava/classpath/ltconfig b/libjava/classpath/ltconfig
+index 743d951..ae4ea60 100755
+--- a/libjava/classpath/ltconfig
++++ b/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch
new file mode 100644
index 000000000..7098e9950
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch
@@ -0,0 +1,87 @@
+From d2d9dd756c4356d14dd7ae003856344cb4f37985 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:40:12 +0400
+Subject: [PATCH 03/35] gcc-uclibc-locale-ctype_touplow_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/generic/c_locale.cc | 5 +++++
+ libstdc++-v3/config/locale/generic/c_locale.h | 9 +++++++++
+ libstdc++-v3/config/os/gnu-linux/ctype_base.h | 9 +++++++++
+ 3 files changed, 23 insertions(+)
+
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
+index 0d309a5..f2f1e1f 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.cc
++++ b/libstdc++-v3/config/locale/generic/c_locale.cc
+@@ -263,5 +263,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
+ #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
+ #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
+ extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
++#ifdef __UCLIBC__
++// This is because __c_locale is of type __ctype_touplow_t* which is short on uclibc. for glibc its int*
++_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPs, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPs);
++#else
+ _GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi);
++#endif
+ #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.h b/libstdc++-v3/config/locale/generic/c_locale.h
+index b5fd989..3da9a5d 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.h
++++ b/libstdc++-v3/config/locale/generic/c_locale.h
+@@ -40,13 +40,22 @@
+
+ #include <clocale>
+
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ #define _GLIBCXX_NUM_CATEGORIES 0
+
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
++#ifdef __UCLIBC__
++ typedef __ctype_touplow_t* __c_locale;
++#else
+ typedef int* __c_locale;
++#endif
+
+ // Convert numeric value of type double and long double to string and
+ // return length of string. If vsnprintf is available use it, otherwise
+diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_base.h b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+index 2d8e978..14eb08f 100644
+--- a/libstdc++-v3/config/os/gnu-linux/ctype_base.h
++++ b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+@@ -33,6 +33,11 @@
+
+ // Information as gleaned from /usr/include/ctype.h
+
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -41,7 +46,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ struct ctype_base
+ {
+ // Non-standard typedefs.
++#ifdef __UCLIBC__
++ typedef const __ctype_touplow_t* __to_type;
++#else
+ typedef const int* __to_type;
++#endif
+
+ // NB: Offsets into ctype<char>::_M_table force a particular size
+ // on the mask type. Because of this, we don't use an enum.
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0004-uclibc-locale.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0004-uclibc-locale.patch
new file mode 100644
index 000000000..49f5f338e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0004-uclibc-locale.patch
@@ -0,0 +1,2862 @@
+From a55c751a449c2cbf0b3fcc07aab1b86bf9661510 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:41:39 +0400
+Subject: [PATCH 04/35] uclibc-locale
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/acinclude.m4 | 37 ++
+ .../config/locale/uclibc/c++locale_internal.h | 63 ++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc | 160 +++++
+ libstdc++-v3/config/locale/uclibc/c_locale.h | 117 ++++
+ .../config/locale/uclibc/codecvt_members.cc | 308 +++++++++
+ .../config/locale/uclibc/collate_members.cc | 80 +++
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 300 +++++++++
+ .../config/locale/uclibc/messages_members.cc | 100 +++
+ .../config/locale/uclibc/messages_members.h | 118 ++++
+ .../config/locale/uclibc/monetary_members.cc | 692 ++++++++++++++++++++
+ .../config/locale/uclibc/numeric_members.cc | 160 +++++
+ libstdc++-v3/config/locale/uclibc/time_members.cc | 406 ++++++++++++
+ libstdc++-v3/config/locale/uclibc/time_members.h | 68 ++
+ libstdc++-v3/configure | 75 +++
+ libstdc++-v3/include/c_compatibility/wchar.h | 2 +
+ libstdc++-v3/include/c_std/cwchar | 2 +
+ 16 files changed, 2688 insertions(+)
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/collate_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/ctype_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/monetary_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/numeric_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.h
+
+diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
+index 0871a6a..326d7ef 100644
+--- a/libstdc++-v3/acinclude.m4
++++ b/libstdc++-v3/acinclude.m4
+@@ -1905,6 +1905,9 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ *-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ enable_clocale_flag=gnu
+ ;;
+@@ -2069,6 +2072,40 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ AC_MSG_RESULT(uclibc)
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++ AC_SUBST(glibcxx_MOFILES)
++ AC_SUBST(glibcxx_POFILES)
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+new file mode 100644
+index 0000000..2ae3e4a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -0,0 +1,63 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <bits/c++config.h>
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
++extern "C" __typeof(strcoll_l) __strcoll_l;
++extern "C" __typeof(strftime_l) __strftime_l;
++extern "C" __typeof(strtod_l) __strtod_l;
++extern "C" __typeof(strtof_l) __strtof_l;
++extern "C" __typeof(strtold_l) __strtold_l;
++extern "C" __typeof(strxfrm_l) __strxfrm_l;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++extern "C" __typeof(iswctype_l) __iswctype_l;
++extern "C" __typeof(towlower_l) __towlower_l;
++extern "C" __typeof(towupper_l) __towupper_l;
++extern "C" __typeof(wcscoll_l) __wcscoll_l;
++extern "C" __typeof(wcsftime_l) __wcsftime_l;
++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
++extern "C" __typeof(wctype_l) __wctype_l;
++#endif
++
++#endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+new file mode 100644
+index 0000000..5081dc1
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -0,0 +1,160 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <cerrno> // For errno
++#include <locale>
++#include <stdexcept>
++#include <langinfo.h>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
++#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
++#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
++#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
++#define __strtof_l(S, E, L) strtof((S), (E))
++#define __strtod_l(S, E, L) strtod((S), (E))
++#define __strtold_l(S, E, L) strtold((S), (E))
++#warning should dummy __newlocale check for C|POSIX ?
++#define __newlocale(a, b, c) NULL
++#define __freelocale(a) ((void)0)
++#define __duplocale(a) __c_locale()
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __f;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __d;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __ld;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ void
++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
++ __c_locale __old)
++ {
++ __cloc = __newlocale(1 << LC_ALL, __s, __old);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ if (!__cloc)
++ {
++ // This named locale is not supported by the underlying OS.
++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
++ "name not valid"));
++ }
++#endif
++ }
++
++ void
++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
++ {
++ if (_S_get_c_locale() != __cloc)
++ __freelocale(__cloc);
++ }
++
++ __c_locale
++ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
++ { return __duplocale(__cloc); }
++} // namespace std
++
++namespace __gnu_cxx
++{
++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
++ {
++ "LC_CTYPE",
++ "LC_NUMERIC",
++ "LC_TIME",
++ "LC_COLLATE",
++ "LC_MONETARY",
++ "LC_MESSAGES",
++#if _GLIBCXX_NUM_CATEGORIES != 0
++ "LC_PAPER",
++ "LC_NAME",
++ "LC_ADDRESS",
++ "LC_TELEPHONE",
++ "LC_MEASUREMENT",
++ "LC_IDENTIFICATION"
++#endif
++ };
++}
++
++namespace std
++{
++ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
++} // namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+new file mode 100644
+index 0000000..da07c1f
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -0,0 +1,117 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifndef _C_LOCALE_H
++#define _C_LOCALE_H 1
++
++#pragma GCC system_header
++
++#include <cstring> // get std::strlen
++#include <cstdio> // get std::snprintf or std::sprintf
++#include <clocale>
++#include <langinfo.h> // For codecvt
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC_HAS_LOCALE__
++#include <iconv.h> // For codecvt using iconv, iconv_t
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#include <libintl.h> // For messages
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning what is _GLIBCXX_C_LOCALE_GNU for
++#endif
++#define _GLIBCXX_C_LOCALE_GNU 1
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix categories
++#endif
++// #define _GLIBCXX_NUM_CATEGORIES 6
++#define _GLIBCXX_NUM_CATEGORIES 0
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++namespace __gnu_cxx
++{
++ extern "C" __typeof(uselocale) __uselocale;
++}
++#endif
++
++namespace std
++{
++#ifdef __UCLIBC_HAS_XLOCALE__
++ typedef __locale_t __c_locale;
++#else
++ typedef int* __c_locale;
++#endif
++
++ // Convert numeric value of type _Tv to string and return length of
++ // string. If snprintf is available use it, otherwise fall back to
++ // the unsafe sprintf which, in general, can be dangerous and should
++ // be avoided.
++ template<typename _Tv>
++ int
++ __convert_from_v(char* __out,
++ const int __size __attribute__ ((__unused__)),
++ const char* __fmt,
++#ifdef __UCLIBC_HAS_XCLOCALE__
++ _Tv __v, const __c_locale& __cloc, int __prec)
++ {
++ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++ _Tv __v, const __c_locale&, int __prec)
++ {
++# ifdef __UCLIBC_HAS_LOCALE__
++ char* __old = std::setlocale(LC_ALL, NULL);
++ char* __sav = new char[std::strlen(__old) + 1];
++ std::strcpy(__sav, __old);
++ std::setlocale(LC_ALL, "C");
++# endif
++#endif
++
++ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++
++#ifdef __UCLIBC_HAS_XCLOCALE__
++ __gnu_cxx::__uselocale(__old);
++#elif defined __UCLIBC_HAS_LOCALE__
++ std::setlocale(LC_ALL, __sav);
++ delete [] __sav;
++#endif
++ return __ret;
++ }
++}
++
++#endif
+diff --git a/libstdc++-v3/config/locale/uclibc/codecvt_members.cc b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+new file mode 100644
+index 0000000..64aa962
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+@@ -0,0 +1,308 @@
++// std::codecvt implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <cstdlib> // For MB_CUR_MAX
++#include <climits> // For MB_LEN_MAX
++#include <bits/c++locale_internal.h>
++
++namespace std
++{
++ // Specializations.
++#ifdef _GLIBCXX_USE_WCHAR_T
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ do_out(state_type& __state, const intern_type* __from,
++ const intern_type* __from_end, const intern_type*& __from_next,
++ extern_type* __to, extern_type* __to_end,
++ extern_type*& __to_next) const
++ {
++ result __ret = ok;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
++ // in case we fall back to wcrtomb and then continue, in a loop.
++ // NB: wcsnrtombs is a GNU extension
++ for (__from_next = __from, __to_next = __to;
++ __from_next < __from_end && __to_next < __to_end
++ && __ret == ok;)
++ {
++ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
++ __from_end - __from_next);
++ if (!__from_chunk_end)
++ __from_chunk_end = __from_end;
++
++ __from = __from_next;
++ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
++ __from_chunk_end - __from_next,
++ __to_end - __to_next, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // wcrtomb.
++ for (; __from < __from_next; ++__from)
++ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
++ __state = __tmp_state;
++ __ret = error;
++ }
++ else if (__from_next && __from_next < __from_chunk_end)
++ {
++ __to_next += __conv;
++ __ret = partial;
++ }
++ else
++ {
++ __from_next = __from_chunk_end;
++ __to_next += __conv;
++ }
++
++ if (__from_next < __from_end && __ret == ok)
++ {
++ extern_type __buf[MB_LEN_MAX];
++ __tmp_state = __state;
++ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
++ if (__conv > static_cast<size_t>(__to_end - __to_next))
++ __ret = partial;
++ else
++ {
++ memcpy(__to_next, __buf, __conv);
++ __state = __tmp_state;
++ __to_next += __conv;
++ ++__from_next;
++ }
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ do_in(state_type& __state, const extern_type* __from,
++ const extern_type* __from_end, const extern_type*& __from_next,
++ intern_type* __to, intern_type* __to_end,
++ intern_type*& __to_next) const
++ {
++ result __ret = ok;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++ // in case we store a L'\0' and then continue, in a loop.
++ // NB: mbsnrtowcs is a GNU extension
++ for (__from_next = __from, __to_next = __to;
++ __from_next < __from_end && __to_next < __to_end
++ && __ret == ok;)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
++ __from_end
++ - __from_next));
++ if (!__from_chunk_end)
++ __from_chunk_end = __from_end;
++
++ __from = __from_next;
++ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
++ __from_chunk_end - __from_next,
++ __to_end - __to_next, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // mbrtowc.
++ for (;; ++__to_next, __from += __conv)
++ {
++ __conv = mbrtowc(__to_next, __from, __from_end - __from,
++ &__tmp_state);
++ if (__conv == static_cast<size_t>(-1)
++ || __conv == static_cast<size_t>(-2))
++ break;
++ }
++ __from_next = __from;
++ __state = __tmp_state;
++ __ret = error;
++ }
++ else if (__from_next && __from_next < __from_chunk_end)
++ {
++ // It is unclear what to return in this case (see DR 382).
++ __to_next += __conv;
++ __ret = partial;
++ }
++ else
++ {
++ __from_next = __from_chunk_end;
++ __to_next += __conv;
++ }
++
++ if (__from_next < __from_end && __ret == ok)
++ {
++ if (__to_next < __to_end)
++ {
++ // XXX Probably wrong for stateful encodings
++ __tmp_state = __state;
++ ++__from_next;
++ *__to_next++ = L'\0';
++ }
++ else
++ __ret = partial;
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_encoding() const throw()
++ {
++ // XXX This implementation assumes that the encoding is
++ // stateless and is either single-byte or variable-width.
++ int __ret = 0;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++ if (MB_CUR_MAX == 1)
++ __ret = 1;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_max_length() const throw()
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++ // XXX Probably wrong for stateful encodings.
++ int __ret = MB_CUR_MAX;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_length(state_type& __state, const extern_type* __from,
++ const extern_type* __end, size_t __max) const
++ {
++ int __ret = 0;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++ // in case we advance past it and then continue, in a loop.
++ // NB: mbsnrtowcs is a GNU extension
++
++ // A dummy internal buffer is needed in order for mbsnrtocws to consider
++ // its fourth parameter (it wouldn't with NULL as first parameter).
++ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
++ * __max));
++ while (__from < __end && __max)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
++ __end
++ - __from));
++ if (!__from_chunk_end)
++ __from_chunk_end = __end;
++
++ const extern_type* __tmp_from = __from;
++ size_t __conv = mbsnrtowcs(__to, &__from,
++ __from_chunk_end - __from,
++ __max, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // mbrtowc.
++ for (__from = __tmp_from;; __from += __conv)
++ {
++ __conv = mbrtowc(NULL, __from, __end - __from,
++ &__tmp_state);
++ if (__conv == static_cast<size_t>(-1)
++ || __conv == static_cast<size_t>(-2))
++ break;
++ }
++ __state = __tmp_state;
++ __ret += __from - __tmp_from;
++ break;
++ }
++ if (!__from)
++ __from = __from_chunk_end;
++
++ __ret += __from - __tmp_from;
++ __max -= __conv;
++
++ if (__from < __end && __max)
++ {
++ // XXX Probably wrong for stateful encodings
++ __tmp_state = __state;
++ ++__from;
++ ++__ret;
++ --__max;
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+new file mode 100644
+index 0000000..c2664a7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -0,0 +1,80 @@
++// std::collate implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
++#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
++#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
++#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
++#endif
++
++namespace std
++{
++ // These are basically extensions to char_traits, and perhaps should
++ // be put there instead of here.
++ template<>
++ int
++ collate<char>::_M_compare(const char* __one, const char* __two) const
++ {
++ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++ }
++
++ template<>
++ size_t
++ collate<char>::_M_transform(char* __to, const char* __from,
++ size_t __n) const
++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ int
++ collate<wchar_t>::_M_compare(const wchar_t* __one,
++ const wchar_t* __two) const
++ {
++ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++ }
++
++ template<>
++ size_t
++ collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
++ size_t __n) const
++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+new file mode 100644
+index 0000000..7294e3a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -0,0 +1,300 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __wctype_l(S, L) wctype((S))
++#define __towupper_l(C, L) towupper((C))
++#define __towlower_l(C, L) towlower((C))
++#define __iswctype_l(C, M, L) iswctype((C), (M))
++#endif
++
++namespace std
++{
++ // NB: The other ctype<char> specializations are in src/locale.cc and
++ // various /config/os/* files.
++ template<>
++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++ : ctype<char>(0, false, __refs)
++ {
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
++ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
++ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
++#endif
++ }
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ ctype<wchar_t>::__wmask_type
++ ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
++ {
++ __wmask_type __ret;
++ switch (__m)
++ {
++ case space:
++ __ret = __wctype_l("space", _M_c_locale_ctype);
++ break;
++ case print:
++ __ret = __wctype_l("print", _M_c_locale_ctype);
++ break;
++ case cntrl:
++ __ret = __wctype_l("cntrl", _M_c_locale_ctype);
++ break;
++ case upper:
++ __ret = __wctype_l("upper", _M_c_locale_ctype);
++ break;
++ case lower:
++ __ret = __wctype_l("lower", _M_c_locale_ctype);
++ break;
++ case alpha:
++ __ret = __wctype_l("alpha", _M_c_locale_ctype);
++ break;
++ case digit:
++ __ret = __wctype_l("digit", _M_c_locale_ctype);
++ break;
++ case punct:
++ __ret = __wctype_l("punct", _M_c_locale_ctype);
++ break;
++ case xdigit:
++ __ret = __wctype_l("xdigit", _M_c_locale_ctype);
++ break;
++ case alnum:
++ __ret = __wctype_l("alnum", _M_c_locale_ctype);
++ break;
++ case graph:
++ __ret = __wctype_l("graph", _M_c_locale_ctype);
++ break;
++ default:
++ __ret = __wmask_type();
++ }
++ return __ret;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_toupper(wchar_t __c) const
++ { return __towupper_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_tolower(wchar_t __c) const
++ { return __towlower_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ bool
++ ctype<wchar_t>::
++ do_is(mask __m, wchar_t __c) const
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ bool __ret = false;
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur]
++ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ return __ret;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
++ {
++ for (; __lo < __hi; ++__vec, ++__lo)
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ const size_t __bitmasksize = 11;
++ mask __m = 0;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
++ __m |= _M_bit[__bitcur];
++ *__vec = __m;
++ }
++ return __hi;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi && !this->do_is(__m, *__lo))
++ ++__lo;
++ return __lo;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
++ {
++ while (__lo < __hi && this->do_is(__m, *__lo) != 0)
++ ++__lo;
++ return __lo;
++ }
++
++ wchar_t
++ ctype<wchar_t>::
++ do_widen(char __c) const
++ { return _M_widen[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<wchar_t>::
++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++ {
++ while (__lo < __hi)
++ {
++ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++ ++__lo;
++ ++__dest;
++ }
++ return __hi;
++ }
++
++ char
++ ctype<wchar_t>::
++ do_narrow(wchar_t __wc, char __dfault) const
++ {
++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
++ return _M_narrow[__wc];
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ const int __c = wctob(__wc);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
++ char* __dest) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ if (_M_narrow_ok)
++ while (__lo < __hi)
++ {
++ if (*__lo >= 0 && *__lo < 128)
++ *__dest = _M_narrow[*__lo];
++ else
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++ ++__lo;
++ ++__dest;
++ }
++ else
++ while (__lo < __hi)
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ ++__lo;
++ ++__dest;
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __hi;
++ }
++
++ void
++ ctype<wchar_t>::_M_initialize_ctype()
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ wint_t __i;
++ for (__i = 0; __i < 128; ++__i)
++ {
++ const int __c = wctob(__i);
++ if (__c == EOF)
++ break;
++ else
++ _M_narrow[__i] = static_cast<char>(__c);
++ }
++ if (__i == 128)
++ _M_narrow_ok = true;
++ else
++ _M_narrow_ok = false;
++ for (size_t __j = 0;
++ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
++ _M_widen[__j] = btowc(__j);
++
++ for (size_t __k = 0; __k <= 11; ++__k)
++ {
++ _M_bit[__k] = static_cast<mask>(_ISbit(__k));
++ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ }
++#endif // _GLIBCXX_USE_WCHAR_T
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+new file mode 100644
+index 0000000..13594d9
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -0,0 +1,100 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix gettext stuff
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__dcgettext(const char *domainname,
++ const char *msgid, int category);
++#undef gettext
++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#else
++#undef gettext
++#define gettext(msgid) (msgid)
++#endif
++
++namespace std
++{
++ // Specializations.
++ template<>
++ string
++ messages<char>::do_get(catalog, int, int, const string& __dfault) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_messages);
++ const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
++ __uselocale(__old);
++ return string(__msg);
++#elif defined __UCLIBC_HAS_LOCALE__
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_messages);
++ const char* __msg = gettext(__dfault.c_str());
++ setlocale(LC_ALL, __old);
++ free(__old);
++ return string(__msg);
++#else
++ const char* __msg = gettext(__dfault.c_str());
++ return string(__msg);
++#endif
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ wstring
++ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
++ {
++# ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_messages);
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ __uselocale(__old);
++ return _M_convert_from_char(__msg);
++# elif defined __UCLIBC_HAS_LOCALE__
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_messages);
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ setlocale(LC_ALL, __old);
++ free(__old);
++ return _M_convert_from_char(__msg);
++# else
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ return _M_convert_from_char(__msg);
++# endif
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+new file mode 100644
+index 0000000..1424078
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -0,0 +1,118 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix prototypes for *textdomain funcs
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__textdomain(const char *domainname);
++extern "C" char *__bindtextdomain(const char *domainname,
++ const char *dirname);
++#else
++#undef __textdomain
++#undef __bindtextdomain
++#define __textdomain(D) ((void)0)
++#define __bindtextdomain(D,P) ((void)0)
++#endif
++
++ // Non-virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::messages(size_t __refs)
++ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
++ _M_name_messages(_S_get_c_name())
++ { }
++
++ template<typename _CharT>
++ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
++ size_t __refs)
++ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
++ _M_name_messages(__s)
++ {
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ _M_name_messages = __tmp;
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
++ const char* __dir) const
++ {
++ __bindtextdomain(__s.c_str(), __dir);
++ return this->do_open(__s, __loc);
++ }
++
++ // Virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::~messages()
++ {
++ if (_M_name_messages != _S_get_c_name())
++ delete [] _M_name_messages;
++ _S_destroy_c_locale(_M_c_locale_messages);
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::do_open(const basic_string<char>& __s,
++ const locale&) const
++ {
++ // No error checking is done, assume the catalog exists and can
++ // be used.
++ __textdomain(__s.c_str());
++ return 0;
++ }
++
++ template<typename _CharT>
++ void
++ messages<_CharT>::do_close(catalog) const
++ { }
++
++ // messages_byname
++ template<typename _CharT>
++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
++ : messages<_CharT>(__refs)
++ {
++ if (this->_M_name_messages != locale::facet::_S_get_c_name())
++ delete [] this->_M_name_messages;
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ this->_M_name_messages = __tmp;
++
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ this->_S_destroy_c_locale(this->_M_c_locale_messages);
++ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
++ }
++ }
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+new file mode 100644
+index 0000000..aa52731
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -0,0 +1,692 @@
++// std::moneypunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning optimize this for uclibc
++#warning tailor for stub locale support
++#endif
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ // Construct and return valid pattern consisting of some combination of:
++ // space none symbol sign value
++ money_base::pattern
++ money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
++ {
++ pattern __ret;
++
++ // This insanely complicated routine attempts to construct a valid
++ // pattern for use with monyepunct. A couple of invariants:
++
++ // if (__precedes) symbol -> value
++ // else value -> symbol
++
++ // if (__space) space
++ // else none
++
++ // none == never first
++ // space never first or last
++
++ // Any elegant implementations of this are welcome.
++ switch (__posn)
++ {
++ case 0:
++ case 1:
++ // 1 The sign precedes the value and symbol.
++ __ret.field[0] = sign;
++ if (__space)
++ {
++ // Pattern starts with sign.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[3] = symbol;
++ }
++ __ret.field[2] = space;
++ }
++ else
++ {
++ // Pattern starts with sign and ends with none.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[3] = none;
++ }
++ break;
++ case 2:
++ // 2 The sign follows the value and symbol.
++ if (__space)
++ {
++ // Pattern either ends with sign.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[1] = space;
++ __ret.field[3] = sign;
++ }
++ else
++ {
++ // Pattern ends with sign then none.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = symbol;
++ }
++ __ret.field[2] = sign;
++ __ret.field[3] = none;
++ }
++ break;
++ case 3:
++ // 3 The sign immediately precedes the symbol.
++ if (__precedes)
++ {
++ __ret.field[0] = sign;
++ __ret.field[1] = symbol;
++ if (__space)
++ {
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[2] = value;
++ __ret.field[3] = none;
++ }
++ }
++ else
++ {
++ __ret.field[0] = value;
++ if (__space)
++ {
++ __ret.field[1] = space;
++ __ret.field[2] = sign;
++ __ret.field[3] = symbol;
++ }
++ else
++ {
++ __ret.field[1] = sign;
++ __ret.field[2] = symbol;
++ __ret.field[3] = none;
++ }
++ }
++ break;
++ case 4:
++ // 4 The sign immediately follows the symbol.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = sign;
++ if (__space)
++ {
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[2] = value;
++ __ret.field[3] = none;
++ }
++ }
++ else
++ {
++ __ret.field[0] = value;
++ if (__space)
++ {
++ __ret.field[1] = space;
++ __ret.field[2] = symbol;
++ __ret.field[3] = sign;
++ }
++ else
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = sign;
++ __ret.field[3] = none;
++ }
++ }
++ break;
++ default:
++ ;
++ }
++ return __ret;
++ }
++
++ template<>
++ void
++ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, true>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = "";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = "";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = "";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++ __cloc));
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_data->_M_negative_sign = "()";
++ else
++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++ __cloc);
++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++ // _Intl == true
++ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++ __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++ }
++ }
++
++ template<>
++ void
++ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, false>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = "";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = "";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = "";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++ __cloc));
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_data->_M_negative_sign = "()";
++ else
++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++ __cloc);
++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++ // _Intl == false
++ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++ }
++ }
++
++ template<>
++ moneypunct<char, true>::~moneypunct()
++ { delete _M_data; }
++
++ template<>
++ moneypunct<char, false>::~moneypunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<wchar_t, true>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++ __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ void
++ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<wchar_t, false>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len;
++ __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ moneypunct<wchar_t, true>::~moneypunct()
++ {
++ if (_M_data->_M_positive_sign_size)
++ delete [] _M_data->_M_positive_sign;
++ if (_M_data->_M_negative_sign_size
++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++ delete [] _M_data->_M_negative_sign;
++ if (_M_data->_M_curr_symbol_size)
++ delete [] _M_data->_M_curr_symbol;
++ delete _M_data;
++ }
++
++ template<>
++ moneypunct<wchar_t, false>::~moneypunct()
++ {
++ if (_M_data->_M_positive_sign_size)
++ delete [] _M_data->_M_positive_sign;
++ if (_M_data->_M_negative_sign_size
++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++ delete [] _M_data->_M_negative_sign;
++ if (_M_data->_M_curr_symbol_size)
++ delete [] _M_data->_M_curr_symbol;
++ delete _M_data;
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+new file mode 100644
+index 0000000..883ec1a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -0,0 +1,160 @@
++// std::numpunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<char>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_use_grouping = false;
++
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
++ __cloc));
++
++ // Check for NULL, which implies no grouping.
++ if (_M_data->_M_thousands_sep == '\0')
++ _M_data->_M_grouping = "";
++ else
++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ }
++
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_data->_M_truename = "true";
++ _M_data->_M_truename_size = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = "false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ template<>
++ numpunct<char>::~numpunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<wchar_t>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_use_grouping = false;
++
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ _M_data->_M_atoms_out[__i] =
++ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ _M_data->_M_atoms_in[__j] =
++ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
++ }
++ else
++ {
++ // Named locale.
++ // NB: In the GNU model wchar_t is always 32 bit wide.
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++
++ if (_M_data->_M_thousands_sep == L'\0')
++ _M_data->_M_grouping = "";
++ else
++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ }
++
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_data->_M_truename = L"true";
++ _M_data->_M_truename_size = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = L"false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ template<>
++ numpunct<wchar_t>::~numpunct()
++ { delete _M_data; }
++ #endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+new file mode 100644
+index 0000000..e0707d7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -0,0 +1,406 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __timepunct<char>::
++ _M_put(char* __s, size_t __maxlen, const char* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = strftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = '\0';
++ }
++
++ template<>
++ void
++ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<char>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_get_c_locale();
++
++ _M_data->_M_date_format = "%m/%d/%y";
++ _M_data->_M_date_era_format = "%m/%d/%y";
++ _M_data->_M_time_format = "%H:%M:%S";
++ _M_data->_M_time_era_format = "%H:%M:%S";
++ _M_data->_M_date_time_format = "";
++ _M_data->_M_date_time_era_format = "";
++ _M_data->_M_am = "AM";
++ _M_data->_M_pm = "PM";
++ _M_data->_M_am_pm_format = "";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = "Sunday";
++ _M_data->_M_day2 = "Monday";
++ _M_data->_M_day3 = "Tuesday";
++ _M_data->_M_day4 = "Wednesday";
++ _M_data->_M_day5 = "Thursday";
++ _M_data->_M_day6 = "Friday";
++ _M_data->_M_day7 = "Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = "Sun";
++ _M_data->_M_aday2 = "Mon";
++ _M_data->_M_aday3 = "Tue";
++ _M_data->_M_aday4 = "Wed";
++ _M_data->_M_aday5 = "Thu";
++ _M_data->_M_aday6 = "Fri";
++ _M_data->_M_aday7 = "Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = "January";
++ _M_data->_M_month02 = "February";
++ _M_data->_M_month03 = "March";
++ _M_data->_M_month04 = "April";
++ _M_data->_M_month05 = "May";
++ _M_data->_M_month06 = "June";
++ _M_data->_M_month07 = "July";
++ _M_data->_M_month08 = "August";
++ _M_data->_M_month09 = "September";
++ _M_data->_M_month10 = "October";
++ _M_data->_M_month11 = "November";
++ _M_data->_M_month12 = "December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = "Jan";
++ _M_data->_M_amonth02 = "Feb";
++ _M_data->_M_amonth03 = "Mar";
++ _M_data->_M_amonth04 = "Apr";
++ _M_data->_M_amonth05 = "May";
++ _M_data->_M_amonth06 = "Jun";
++ _M_data->_M_amonth07 = "Jul";
++ _M_data->_M_amonth08 = "Aug";
++ _M_data->_M_amonth09 = "Sep";
++ _M_data->_M_amonth10 = "Oct";
++ _M_data->_M_amonth11 = "Nov";
++ _M_data->_M_amonth12 = "Dec";
++ }
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
++ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
++ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
++ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
++ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
++ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
++ __cloc);
++ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
++ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
++ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
++ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
++ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
++ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
++ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
++ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
++ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
++ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
++ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
++ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
++ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
++ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
++ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
++ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
++ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
++ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
++ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
++ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
++ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
++ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
++ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
++ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
++ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
++ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
++ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
++ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
++ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
++ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
++ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
++ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
++ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
++ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
++ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
++ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
++ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
++ }
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ __timepunct<wchar_t>::
++ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
++ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = L'\0';
++ }
++
++ template<>
++ void
++ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<wchar_t>;
++
++#warning wide time stuff
++// if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_get_c_locale();
++
++ _M_data->_M_date_format = L"%m/%d/%y";
++ _M_data->_M_date_era_format = L"%m/%d/%y";
++ _M_data->_M_time_format = L"%H:%M:%S";
++ _M_data->_M_time_era_format = L"%H:%M:%S";
++ _M_data->_M_date_time_format = L"";
++ _M_data->_M_date_time_era_format = L"";
++ _M_data->_M_am = L"AM";
++ _M_data->_M_pm = L"PM";
++ _M_data->_M_am_pm_format = L"";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = L"Sunday";
++ _M_data->_M_day2 = L"Monday";
++ _M_data->_M_day3 = L"Tuesday";
++ _M_data->_M_day4 = L"Wednesday";
++ _M_data->_M_day5 = L"Thursday";
++ _M_data->_M_day6 = L"Friday";
++ _M_data->_M_day7 = L"Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = L"Sun";
++ _M_data->_M_aday2 = L"Mon";
++ _M_data->_M_aday3 = L"Tue";
++ _M_data->_M_aday4 = L"Wed";
++ _M_data->_M_aday5 = L"Thu";
++ _M_data->_M_aday6 = L"Fri";
++ _M_data->_M_aday7 = L"Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = L"January";
++ _M_data->_M_month02 = L"February";
++ _M_data->_M_month03 = L"March";
++ _M_data->_M_month04 = L"April";
++ _M_data->_M_month05 = L"May";
++ _M_data->_M_month06 = L"June";
++ _M_data->_M_month07 = L"July";
++ _M_data->_M_month08 = L"August";
++ _M_data->_M_month09 = L"September";
++ _M_data->_M_month10 = L"October";
++ _M_data->_M_month11 = L"November";
++ _M_data->_M_month12 = L"December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = L"Jan";
++ _M_data->_M_amonth02 = L"Feb";
++ _M_data->_M_amonth03 = L"Mar";
++ _M_data->_M_amonth04 = L"Apr";
++ _M_data->_M_amonth05 = L"May";
++ _M_data->_M_amonth06 = L"Jun";
++ _M_data->_M_amonth07 = L"Jul";
++ _M_data->_M_amonth08 = L"Aug";
++ _M_data->_M_amonth09 = L"Sep";
++ _M_data->_M_amonth10 = L"Oct";
++ _M_data->_M_amonth11 = L"Nov";
++ _M_data->_M_amonth12 = L"Dec";
++ }
++#if 0
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ union { char *__s; wchar_t *__w; } __u;
++
++ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
++ _M_data->_M_date_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
++ _M_data->_M_date_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
++ _M_data->_M_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
++ _M_data->_M_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
++ _M_data->_M_date_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
++ _M_data->_M_date_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
++ _M_data->_M_am = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
++ _M_data->_M_pm = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
++ _M_data->_M_am_pm_format = __u.__w;
++
++ // Day names, starting with "C"'s Sunday.
++ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
++ _M_data->_M_day1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
++ _M_data->_M_day2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
++ _M_data->_M_day3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
++ _M_data->_M_day4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
++ _M_data->_M_day5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
++ _M_data->_M_day6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
++ _M_data->_M_day7 = __u.__w;
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
++ _M_data->_M_aday1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
++ _M_data->_M_aday2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
++ _M_data->_M_aday3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
++ _M_data->_M_aday4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
++ _M_data->_M_aday5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
++ _M_data->_M_aday6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
++ _M_data->_M_aday7 = __u.__w;
++
++ // Month names, starting with "C"'s January.
++ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
++ _M_data->_M_month01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
++ _M_data->_M_month02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
++ _M_data->_M_month03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
++ _M_data->_M_month04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
++ _M_data->_M_month05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
++ _M_data->_M_month06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
++ _M_data->_M_month07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
++ _M_data->_M_month08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
++ _M_data->_M_month09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
++ _M_data->_M_month10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
++ _M_data->_M_month11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
++ _M_data->_M_month12 = __u.__w;
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
++ _M_data->_M_amonth01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
++ _M_data->_M_amonth02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
++ _M_data->_M_amonth03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
++ _M_data->_M_amonth04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
++ _M_data->_M_amonth05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
++ _M_data->_M_amonth06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
++ _M_data->_M_amonth07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
++ _M_data->_M_amonth08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
++ _M_data->_M_amonth09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
++ _M_data->_M_amonth10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
++ _M_data->_M_amonth11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
++ _M_data->_M_amonth12 = __u.__w;
++ }
++#endif // 0
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+new file mode 100644
+index 0000000..ba8e858
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -0,0 +1,68 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(size_t __refs)
++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(_S_get_c_name())
++ { _M_initialize_timepunct(); }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
++ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(_S_get_c_name())
++ { _M_initialize_timepunct(); }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
++ size_t __refs)
++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(__s)
++ {
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ _M_name_timepunct = __tmp;
++ _M_initialize_timepunct(__cloc);
++ }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::~__timepunct()
++ {
++ if (_M_name_timepunct != _S_get_c_name())
++ delete [] _M_name_timepunct;
++ delete _M_data;
++ _S_destroy_c_locale(_M_c_locale_timepunct);
++ }
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index f40ddcf..c57a751 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -15822,6 +15822,9 @@ fi
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ *-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ enable_clocale_flag=gnu
+ ;;
+@@ -16079,6 +16082,78 @@ $as_echo "newlib" >&6; }
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: uclibc" >&5
++$as_echo "uclibc" >&6; }
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ # Extract the first word of "msgfmt", so it can be a program name with args.
++set dummy msgfmt; 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_check_msgfmt+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$check_msgfmt"; then
++ ac_cv_prog_check_msgfmt="$check_msgfmt" # 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_check_msgfmt="yes"
++ $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
++
++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
++fi
++fi
++check_msgfmt=$ac_cv_prog_check_msgfmt
++if test -n "$check_msgfmt"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_msgfmt" >&5
++$as_echo "$check_msgfmt" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++
++
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/include/c_compatibility/wchar.h b/libstdc++-v3/include/c_compatibility/wchar.h
+index 580d725..3fe61b8 100644
+--- a/libstdc++-v3/include/c_compatibility/wchar.h
++++ b/libstdc++-v3/include/c_compatibility/wchar.h
+@@ -101,7 +101,9 @@ using std::wmemcmp;
+ using std::wmemcpy;
+ using std::wmemmove;
+ using std::wmemset;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using std::wcsftime;
++#endif
+
+ #if _GLIBCXX_USE_C99
+ using std::wcstold;
+diff --git a/libstdc++-v3/include/c_std/cwchar b/libstdc++-v3/include/c_std/cwchar
+index 0e6b1fc..405aee2 100644
+--- a/libstdc++-v3/include/c_std/cwchar
++++ b/libstdc++-v3/include/c_std/cwchar
+@@ -175,7 +175,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using ::wcsftime;
++#endif
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0005-uclibc-locale-no__x.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0005-uclibc-locale-no__x.patch
new file mode 100644
index 000000000..dcbbfe454
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0005-uclibc-locale-no__x.patch
@@ -0,0 +1,257 @@
+From 6a3e8506a12c12728d8b29901defd738be43757f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:42:36 +0400
+Subject: [PATCH 05/35] uclibc-locale-no__x
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h | 45 ++++++++++++++++++++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc | 14 ------
+ libstdc++-v3/config/locale/uclibc/c_locale.h | 1 +
+ .../config/locale/uclibc/collate_members.cc | 7 ---
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 7 ---
+ .../config/locale/uclibc/messages_members.cc | 7 +--
+ .../config/locale/uclibc/messages_members.h | 18 +++-----
+ .../config/locale/uclibc/monetary_members.cc | 4 --
+ .../config/locale/uclibc/numeric_members.cc | 3 --
+ libstdc++-v3/config/locale/uclibc/time_members.cc | 3 --
+ 10 files changed, 55 insertions(+), 54 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index 2ae3e4a..e74fddf 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -60,4 +60,49 @@ extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
+ extern "C" __typeof(wctype_l) __wctype_l;
+ #endif
+
++# define __nl_langinfo_l nl_langinfo_l
++# define __strcoll_l strcoll_l
++# define __strftime_l strftime_l
++# define __strtod_l strtod_l
++# define __strtof_l strtof_l
++# define __strtold_l strtold_l
++# define __strxfrm_l strxfrm_l
++# define __newlocale newlocale
++# define __freelocale freelocale
++# define __duplocale duplocale
++# define __uselocale uselocale
++
++# ifdef _GLIBCXX_USE_WCHAR_T
++# define __iswctype_l iswctype_l
++# define __towlower_l towlower_l
++# define __towupper_l towupper_l
++# define __wcscoll_l wcscoll_l
++# define __wcsftime_l wcsftime_l
++# define __wcsxfrm_l wcsxfrm_l
++# define __wctype_l wctype_l
++# endif
++
++#else
++# define __nl_langinfo_l(N, L) nl_langinfo((N))
++# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
++# define __strtod_l(S, E, L) strtod((S), (E))
++# define __strtof_l(S, E, L) strtof((S), (E))
++# define __strtold_l(S, E, L) strtold((S), (E))
++# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
++# warning should dummy __newlocale check for C|POSIX ?
++# define __newlocale(a, b, c) NULL
++# define __freelocale(a) ((void)0)
++# define __duplocale(a) __c_locale()
++//# define __uselocale ?
++//
++# ifdef _GLIBCXX_USE_WCHAR_T
++# define __iswctype_l(C, M, L) iswctype((C), (M))
++# define __towlower_l(C, L) towlower((C))
++# define __towupper_l(C, L) towupper((C))
++# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
++//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
++# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
++# define __wctype_l(S, L) wctype((S))
++# endif
++
+ #endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 5081dc1..21430d0 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,20 +39,6 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
+-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
+-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
+-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
+-#define __strtof_l(S, E, L) strtof((S), (E))
+-#define __strtod_l(S, E, L) strtod((S), (E))
+-#define __strtold_l(S, E, L) strtold((S), (E))
+-#warning should dummy __newlocale check for C|POSIX ?
+-#define __newlocale(a, b, c) NULL
+-#define __freelocale(a) ((void)0)
+-#define __duplocale(a) __c_locale()
+-#endif
+-
+ namespace std
+ {
+ template<>
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index da07c1f..4bca5f1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -68,6 +68,7 @@ namespace __gnu_cxx
+ {
+ extern "C" __typeof(uselocale) __uselocale;
+ }
++#define __uselocale uselocale
+ #endif
+
+ namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+index c2664a7..ec5c329 100644
+--- a/libstdc++-v3/config/locale/uclibc/collate_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -36,13 +36,6 @@
+ #include <locale>
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
+-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
+-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
+-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
+-#endif
+-
+ namespace std
+ {
+ // These are basically extensions to char_traits, and perhaps should
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7294e3a..7b12861 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -38,13 +38,6 @@
+ #undef _LIBC
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __wctype_l(S, L) wctype((S))
+-#define __towupper_l(C, L) towupper((C))
+-#define __towlower_l(C, L) towlower((C))
+-#define __iswctype_l(C, M, L) iswctype((C), (M))
+-#endif
+-
+ namespace std
+ {
+ // NB: The other ctype<char> specializations are in src/locale.cc and
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+index 13594d9..d7693b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -39,13 +39,10 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix gettext stuff
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__dcgettext(const char *domainname,
+- const char *msgid, int category);
+ #undef gettext
+-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
+ #else
+-#undef gettext
+ #define gettext(msgid) (msgid)
+ #endif
+
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index 1424078..d89da33 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -36,15 +36,11 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix prototypes for *textdomain funcs
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__textdomain(const char *domainname);
+-extern "C" char *__bindtextdomain(const char *domainname,
+- const char *dirname);
+-#else
+-#undef __textdomain
+-#undef __bindtextdomain
+-#define __textdomain(D) ((void)0)
+-#define __bindtextdomain(D,P) ((void)0)
++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#undef textdomain
++#undef bindtextdomain
++#define textdomain(D) ((void)0)
++#define bindtextdomain(D,P) ((void)0)
+ #endif
+
+ // Non-virtual member functions.
+@@ -70,7 +66,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
+ const char* __dir) const
+ {
+- __bindtextdomain(__s.c_str(), __dir);
++ bindtextdomain(__s.c_str(), __dir);
+ return this->do_open(__s, __loc);
+ }
+
+@@ -90,7 +86,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+ {
+ // No error checking is done, assume the catalog exists and can
+ // be used.
+- __textdomain(__s.c_str());
++ textdomain(__s.c_str());
+ return 0;
+ }
+
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index aa52731..2e6f80a 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -43,10 +43,6 @@
+ #warning tailor for stub locale support
+ #endif
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+-
+ namespace std
+ {
+ // Construct and return valid pattern consisting of some combination of:
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 883ec1a..2c70642 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -41,9 +41,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+
+ namespace std
+ {
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index e0707d7..d848ed5 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -40,9 +40,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+
+ namespace std
+ {
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0006-uclibc-locale-wchar_fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0006-uclibc-locale-wchar_fix.patch
new file mode 100644
index 000000000..3406859e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0006-uclibc-locale-wchar_fix.patch
@@ -0,0 +1,68 @@
+From 225511a3aeb193a916b3999f0b640a392caa67cd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:45:57 +0400
+Subject: [PATCH 06/35] uclibc-locale-wchar_fix
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/uclibc/monetary_members.cc | 4 ++--
+ libstdc++-v3/config/locale/uclibc/numeric_members.cc | 13 +++++++++++++
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 2e6f80a..31ebb9f 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -401,7 +401,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+@@ -556,7 +556,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 2c70642..d5c8961 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -127,12 +127,25 @@ namespace std
+ {
+ // Named locale.
+ // NB: In the GNU model wchar_t is always 32 bit wide.
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be numeric
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
+ union { char *__s; wchar_t __w; } __u;
+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
+ _M_data->_M_decimal_point = __u.__w;
+
+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
+ _M_data->_M_thousands_sep = __u.__w;
++#endif
+
+ if (_M_data->_M_thousands_sep == L'\0')
+ _M_data->_M_grouping = "";
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0007-uclibc-locale-update.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0007-uclibc-locale-update.patch
new file mode 100644
index 000000000..58511233d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0007-uclibc-locale-update.patch
@@ -0,0 +1,542 @@
+From 6ffe7c46f52d27864c3df3663e16ec9ddee71e8f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:46:58 +0400
+Subject: [PATCH 07/35] uclibc-locale-update
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h | 3 +
+ libstdc++-v3/config/locale/uclibc/c_locale.cc | 74 +++++++++-----------
+ libstdc++-v3/config/locale/uclibc/c_locale.h | 42 ++++++-----
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 51 ++++++++++----
+ .../config/locale/uclibc/messages_members.h | 12 ++--
+ .../config/locale/uclibc/monetary_members.cc | 34 +++++----
+ .../config/locale/uclibc/numeric_members.cc | 5 ++
+ libstdc++-v3/config/locale/uclibc/time_members.cc | 18 +++--
+ libstdc++-v3/config/locale/uclibc/time_members.h | 17 +++--
+ 9 files changed, 158 insertions(+), 98 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index e74fddf..971a6b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -31,6 +31,9 @@
+
+ #include <bits/c++config.h>
+ #include <clocale>
++#include <cstdlib>
++#include <cstring>
++#include <cstddef>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning clean this up
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 21430d0..1b9d8e1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,23 +39,20 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+ template<>
+ void
+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- float __f = __strtof_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __f;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __f;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ template<>
+@@ -63,16 +60,13 @@ namespace std
+ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- double __d = __strtod_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __d;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __d;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ template<>
+@@ -80,16 +74,13 @@ namespace std
+ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- long double __ld = __strtold_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __ld;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __ld;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ void
+@@ -110,17 +101,18 @@ namespace std
+ void
+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
+ {
+- if (_S_get_c_locale() != __cloc)
++ if (__cloc && _S_get_c_locale() != __cloc)
+ __freelocale(__cloc);
+ }
+
+ __c_locale
+ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
+ { return __duplocale(__cloc); }
+-} // namespace std
+
+-namespace __gnu_cxx
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
++
+ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
+ {
+ "LC_CTYPE",
+@@ -138,9 +130,11 @@ namespace __gnu_cxx
+ "LC_IDENTIFICATION"
+ #endif
+ };
+-}
+
+-namespace std
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
+-} // namespace std
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index 4bca5f1..64a6d46 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -39,21 +39,23 @@
+ #pragma GCC system_header
+
+ #include <cstring> // get std::strlen
+-#include <cstdio> // get std::snprintf or std::sprintf
++#include <cstdio> // get std::vsnprintf or std::vsprintf
+ #include <clocale>
+ #include <langinfo.h> // For codecvt
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix this
+ #endif
+-#ifdef __UCLIBC_HAS_LOCALE__
++#ifdef _GLIBCXX_USE_ICONV
+ #include <iconv.h> // For codecvt using iconv, iconv_t
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-#include <libintl.h> // For messages
++#ifdef HAVE_LIBINTL_H
++#include <libintl.h> // For messages
+ #endif
++#include <cstdarg>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning what is _GLIBCXX_C_LOCALE_GNU for
++// psm: used in os/gnu-linux/ctype_noninline.h
+ #endif
+ #define _GLIBCXX_C_LOCALE_GNU 1
+
+@@ -78,23 +80,25 @@ namespace std
+ #else
+ typedef int* __c_locale;
+ #endif
+-
+- // Convert numeric value of type _Tv to string and return length of
+- // string. If snprintf is available use it, otherwise fall back to
+- // the unsafe sprintf which, in general, can be dangerous and should
++ // Convert numeric value of type double to string and return length of
++ // string. If vsnprintf is available use it, otherwise fall back to
++ // the unsafe vsprintf which, in general, can be dangerous and should
+ // be avoided.
+- template<typename _Tv>
+- int
+- __convert_from_v(char* __out,
+- const int __size __attribute__ ((__unused__)),
+- const char* __fmt,
+-#ifdef __UCLIBC_HAS_XCLOCALE__
+- _Tv __v, const __c_locale& __cloc, int __prec)
++ inline int
++ __convert_from_v(const __c_locale&
++#ifndef __UCLIBC_HAS_XCLOCALE__
++ __cloc __attribute__ ((__unused__))
++#endif
++ ,
++ char* __out,
++ const int __size,
++ const char* __fmt, ...)
+ {
++ va_list __args;
++#ifdef __UCLIBC_HAS_XCLOCALE__
++
+ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
+ #else
+- _Tv __v, const __c_locale&, int __prec)
+- {
+ # ifdef __UCLIBC_HAS_LOCALE__
+ char* __old = std::setlocale(LC_ALL, NULL);
+ char* __sav = new char[std::strlen(__old) + 1];
+@@ -103,7 +107,9 @@ namespace std
+ # endif
+ #endif
+
+- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++ va_start(__args, __fmt);
++ const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
++ va_end(__args);
+
+ #ifdef __UCLIBC_HAS_XCLOCALE__
+ __gnu_cxx::__uselocale(__old);
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7b12861..13e011d 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -33,16 +33,20 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+ // NB: The other ctype<char> specializations are in src/locale.cc and
+ // various /config/os/* files.
+- template<>
+ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
+ : ctype<char>(0, false, __refs)
+ {
+@@ -57,6 +61,8 @@ namespace std
+ #endif
+ }
+ }
++ ctype_byname<char>::~ctype_byname()
++ { }
+
+ #ifdef _GLIBCXX_USE_WCHAR_T
+ ctype<wchar_t>::__wmask_type
+@@ -138,17 +144,33 @@ namespace std
+ ctype<wchar_t>::
+ do_is(mask __m, wchar_t __c) const
+ {
+- // Highest bitmask in ctype_base == 10, but extra in "C"
+- // library for blank.
++ // The case of __m == ctype_base::space is particularly important,
++ // due to its use in many istream functions. Therefore we deal with
++ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
++ // is the mask corresponding to ctype_base::space. NB: an encoding
++ // change would not affect correctness!
++
+ bool __ret = false;
+- const size_t __bitmasksize = 11;
+- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
+- if (__m & _M_bit[__bitcur]
+- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
+- {
+- __ret = true;
+- break;
+- }
++ if (__m == _M_bit[5])
++ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
++ else
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur])
++ {
++ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ else if (__m == _M_bit[__bitcur])
++ break;
++ }
++ }
++
+ return __ret;
+ }
+
+@@ -290,4 +312,5 @@ namespace std
+ #endif
+ }
+ #endif // _GLIBCXX_USE_WCHAR_T
+-}
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index d89da33..067657a 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -53,12 +53,16 @@
+ template<typename _CharT>
+ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
+ size_t __refs)
+- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
+- _M_name_messages(__s)
++ : facet(__refs), _M_c_locale_messages(NULL),
++ _M_name_messages(NULL)
+ {
+- char* __tmp = new char[std::strlen(__s) + 1];
+- std::strcpy(__tmp, __s);
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
+ _M_name_messages = __tmp;
++
++ // Last to avoid leaking memory if new throws.
++ _M_c_locale_messages = _S_clone_c_locale(__cloc);
+ }
+
+ template<typename _CharT>
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 31ebb9f..7679b9c 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -33,9 +33,14 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -206,7 +211,7 @@ namespace std
+ }
+ break;
+ default:
+- ;
++ __ret = pattern();
+ }
+ return __ret;
+ }
+@@ -390,7 +395,9 @@ namespace std
+ __c_locale __old = __uselocale(__cloc);
+ #else
+ // Switch to named locale so that mbsrtowcs will work.
+- char* __old = strdup(setlocale(LC_ALL, NULL));
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
+ setlocale(LC_ALL, __name);
+ #endif
+
+@@ -477,8 +484,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ __throw_exception_again;
+ }
+@@ -498,8 +505,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ }
+ }
+@@ -545,8 +552,11 @@ namespace std
+ __c_locale __old = __uselocale(__cloc);
+ #else
+ // Switch to named locale so that mbsrtowcs will work.
+- char* __old = strdup(setlocale(LC_ALL, NULL));
+- setlocale(LC_ALL, __name);
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
++ memcpy(__sav, __old, __llen);
++ setlocale(LC_ALL, __name);
+ #endif
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -633,8 +643,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ __throw_exception_again;
+ }
+@@ -653,8 +663,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ }
+ }
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index d5c8961..8ae8969 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -33,9 +33,14 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index d848ed5..f24d53e 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -53,11 +53,14 @@ namespace std
+ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
+ _M_c_locale_timepunct);
+ #else
+- char* __old = strdup(setlocale(LC_ALL, NULL));
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
++ memcpy(__sav, __old, __llen);
+ setlocale(LC_ALL, _M_name_timepunct);
+ const size_t __len = strftime(__s, __maxlen, __format, __tm);
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ // Make sure __s is null terminated.
+ if (__len == 0)
+@@ -207,11 +210,14 @@ namespace std
+ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
+ _M_c_locale_timepunct);
+ #else
+- char* __old = strdup(setlocale(LC_ALL, NULL));
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
++ memcpy(__sav, __old, __llen);
+ setlocale(LC_ALL, _M_name_timepunct);
+ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ // Make sure __s is null terminated.
+ if (__len == 0)
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+index ba8e858..1665dde 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.h
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -50,12 +50,21 @@
+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
+ size_t __refs)
+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+- _M_name_timepunct(__s)
++ _M_name_timepunct(NULL)
+ {
+- char* __tmp = new char[std::strlen(__s) + 1];
+- std::strcpy(__tmp, __s);
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
+ _M_name_timepunct = __tmp;
+- _M_initialize_timepunct(__cloc);
++
++ try
++ { _M_initialize_timepunct(__cloc); }
++ catch(...)
++ {
++ delete [] _M_name_timepunct;
++ __throw_exception_again;
++ }
++
+ }
+
+ template<typename _CharT>
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0008-missing-execinfo_h.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0008-missing-execinfo_h.patch
new file mode 100644
index 000000000..282380934
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0008-missing-execinfo_h.patch
@@ -0,0 +1,28 @@
+From 9f2158451981cf0a80cfabdc79ae31bb6976a801 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:48:10 +0400
+Subject: [PATCH 08/35] missing-execinfo_h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ boehm-gc/include/gc.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h
+index c51e017..a7ba8dc 100644
+--- a/boehm-gc/include/gc.h
++++ b/boehm-gc/include/gc.h
+@@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb));
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0009-c99-snprintf.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0009-c99-snprintf.patch
new file mode 100644
index 000000000..7168778df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0009-c99-snprintf.patch
@@ -0,0 +1,28 @@
+From e393e076f1ab82d25e1aa04d6edea27b41d3eb06 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:49:03 +0400
+Subject: [PATCH 09/35] c99-snprintf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/include/c_std/cstdio | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libstdc++-v3/include/c_std/cstdio b/libstdc++-v3/include/c_std/cstdio
+index e85bd83..6af839a 100644
+--- a/libstdc++-v3/include/c_std/cstdio
++++ b/libstdc++-v3/include/c_std/cstdio
+@@ -139,7 +139,7 @@ namespace std
+ using ::vsprintf;
+ } // namespace std
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0010-c99-complex-ugly-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0010-c99-complex-ugly-hack.patch
new file mode 100644
index 000000000..b628571e5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0010-c99-complex-ugly-hack.patch
@@ -0,0 +1,29 @@
+From 73f69d806e2c9561a54995223431a1076cfd6164 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:49:57 +0400
+Subject: [PATCH 10/35] c99-complex-ugly-hack
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ libstdc++-v3/configure | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index c57a751..a1333e2 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -18734,6 +18734,9 @@ $as_echo_n "checking for ISO C99 support to TR1 in <complex.h>... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #include <complex.h>
++#ifdef __UCLIBC__
++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
++#endif
+ int
+ main ()
+ {
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0011-index_macro.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0011-index_macro.patch
new file mode 100644
index 000000000..8ee79b09b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0011-index_macro.patch
@@ -0,0 +1,44 @@
+From b037953e40312b45ab84ed0a3ad882bb5e413101 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:51:02 +0400
+Subject: [PATCH 11/35] index_macro
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/include/ext/rope | 3 +++
+ libstdc++-v3/include/ext/ropeimpl.h | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope
+index 38eb1e8..158d21a 100644
+--- a/libstdc++-v3/include/ext/rope
++++ b/libstdc++-v3/include/ext/rope
+@@ -55,6 +55,9 @@
+ #include <bits/gthr.h>
+ #include <tr1/functional>
+
++/* cope w/ index defined as macro, SuSv3 proposal */
++#undef index
++
+ # ifdef __GC
+ # define __GC_CONST const
+ # else
+diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
+index d7b5cbd..b9b3acb 100644
+--- a/libstdc++-v3/include/ext/ropeimpl.h
++++ b/libstdc++-v3/include/ext/ropeimpl.h
+@@ -48,6 +48,9 @@
+ #include <ext/memory> // For uninitialized_copy_n
+ #include <ext/numeric> // For power
+
++/* cope w/ index defined as macro, SuSv3 proposal */
++#undef index
++
+ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0013-libstdc-namespace.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0013-libstdc-namespace.patch
new file mode 100644
index 000000000..4a3efdebd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0013-libstdc-namespace.patch
@@ -0,0 +1,54 @@
+From 104e4d66208f2726b14d2f5eebce90700cbc83c8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:54:02 +0400
+Subject: [PATCH 13/35] libstdc++-namespace
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/uclibc/messages_members.h | 4 +++-
+ libstdc++-v3/config/locale/uclibc/time_members.h | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index 067657a..dd76a6c 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -32,7 +32,8 @@
+ //
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+-
++namespace std
++{
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix prototypes for *textdomain funcs
+ #endif
+@@ -116,3 +117,4 @@
+ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
+ }
+ }
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+index 1665dde..905c433 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.h
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -33,7 +33,8 @@
+ //
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+-
++namespace std
++{
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(size_t __refs)
+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+@@ -75,3 +76,4 @@
+ delete _M_data;
+ _S_destroy_c_locale(_M_c_locale_timepunct);
+ }
++}
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0014-sh-pr24836.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0014-sh-pr24836.patch
new file mode 100644
index 000000000..cb8fd525b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0014-sh-pr24836.patch
@@ -0,0 +1,45 @@
+From edc9acb181810f234b6b9f7d2820b0e4f6a1eeaf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:54:48 +0400
+Subject: [PATCH 14/35] sh-pr24836
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836
+---
+ gcc/configure | 2 +-
+ gcc/configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index e12a180..135bbf5 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -23378,7 +23378,7 @@ foo: .long 25
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index eba3577..6363a21 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -3141,7 +3141,7 @@ foo: .long 25
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch
new file mode 100644
index 000000000..37c46fc2e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch
@@ -0,0 +1,47 @@
+From 50e5366005b0f6af27378e2a5c3cb9f9936a7e62 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:58:36 +0400
+Subject: [PATCH 15/35] arm: Use TARGET_ENDIAN_OPTION for determining
+ MULTILIB_DEFAULTS
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/arm/linux-elf.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: gcc-4.9.2/gcc/config/arm/coff.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/arm/coff.h
++++ gcc-4.9.2/gcc/config/arm/coff.h
+@@ -32,8 +32,11 @@
+ #define TARGET_DEFAULT (MASK_APCS_FRAME)
+
+ #ifndef MULTILIB_DEFAULTS
++#ifndef TARGET_ENDIAN_OPTION
++#define TARGET_ENDIAN_OPTION "mlittle-endian"
++#endif
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "mfloat-abi=soft", "mno-thumb-interwork" }
++ { "marm", TARGET_ENDIAN_OPTION, "mfloat-abi=soft", "mno-thumb-interwork" }
+ #endif
+
+ /* This is COFF, but prefer stabs. */
+Index: gcc-4.9.2/gcc/config/arm/elf.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/arm/elf.h
++++ gcc-4.9.2/gcc/config/arm/elf.h
+@@ -116,8 +116,11 @@
+ #endif
+
+ #ifndef MULTILIB_DEFAULTS
++#ifndef TARGET_ENDIAN_OPTION
++#define TARGET_ENDIAN_OPTION "mlittle-endian"
++#endif
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "mfloat-abi=soft", "mno-thumb-interwork", "fno-leading-underscore" }
++ { "marm", TARGET_ENDIAN_OPTION, "mfloat-abi=soft", "mno-thumb-interwork", "fno-leading-underscore" }
+ #endif
+
+ #define TARGET_ASM_FILE_START_APP_OFF true
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0016-gcc-poison-system-directories.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0016-gcc-poison-system-directories.patch
new file mode 100644
index 000000000..475ef96b9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0016-gcc-poison-system-directories.patch
@@ -0,0 +1,190 @@
+From 160397ef3c3331099af028f1b8d3e085b07d88ad Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:59:00 +0400
+Subject: [PATCH 16/35] gcc: poison-system-directories
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [distribution: codesourcery]
+---
+ gcc/Makefile.in | 2 +-
+ gcc/common.opt | 4 ++++
+ gcc/config.in | 6 ++++++
+ gcc/configure | 20 ++++++++++++++++++--
+ gcc/configure.ac | 10 ++++++++++
+ gcc/doc/invoke.texi | 9 +++++++++
+ gcc/gcc.c | 2 ++
+ gcc/incpath.c | 19 +++++++++++++++++++
+ 8 files changed, 69 insertions(+), 3 deletions(-)
+
+Index: gcc-4.9-20140316/gcc/common.opt
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/common.opt
++++ gcc-4.9-20140316/gcc/common.opt
+@@ -603,6 +603,10 @@ Wpedantic
+ Common Var(pedantic) Warning
+ Issue warnings needed for strict compliance to the standard
+
++Wpoison-system-directories
++Common Var(flag_poison_system_directories) Init(1) Warning
++Warn for -I and -L options using system directories if cross compiling
++
+ Wshadow
+ Common Var(warn_shadow) Warning
+ Warn when one local variable shadows another
+Index: gcc-4.9-20140316/gcc/config.in
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config.in
++++ gcc-4.9-20140316/gcc/config.in
+@@ -138,6 +138,12 @@
+ #endif
+
+
++/* Define to warn for use of native system header directories */
++#ifndef USED_FOR_TARGET
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++#endif
++
++
+ /* Define if you want all operations on RTL (the basic data structure of the
+ optimizer and back end) to be checked for dynamic type safety at runtime.
+ This is quite expensive. */
+Index: gcc-4.9-20140316/gcc/configure
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/configure
++++ gcc-4.9-20140316/gcc/configure
+@@ -928,6 +928,7 @@ with_system_zlib
+ enable_maintainer_mode
+ enable_link_mutex
+ enable_version_specific_runtime_libs
++enable_poison_system_directories
+ enable_plugin
+ enable_host_shared
+ enable_libquadmath_support
+@@ -1648,6 +1649,8 @@ Optional Features:
+ --enable-version-specific-runtime-libs
+ specify that runtime libraries should be installed
+ in a compiler-specific directory
++ --enable-poison-system-directories
++ warn for use of native system header directories
+ --enable-plugin enable plugin support
+ --enable-host-shared build host code as shared libraries
+ --disable-libquadmath-support
+@@ -27702,6 +27705,19 @@ if test "${enable_version_specific_runti
+ 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
++
+ # Substitute configuration variables
+
+
+Index: gcc-4.9-20140316/gcc/configure.ac
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/configure.ac
++++ gcc-4.9-20140316/gcc/configure.ac
+@@ -5366,6 +5366,16 @@ AC_ARG_ENABLE(version-specific-runtime-l
+ [specify that runtime libraries should be
+ installed in a compiler-specific directory])])
+
++AC_ARG_ENABLE([poison-system-directories],
++ AS_HELP_STRING([--enable-poison-system-directories],
++ [warn for use of native system header 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 header directories])
++fi
++
+ # Substitute configuration variables
+ AC_SUBST(subdirs)
+ AC_SUBST(srcdir)
+Index: gcc-4.9-20140316/gcc/doc/invoke.texi
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/doc/invoke.texi
++++ gcc-4.9-20140316/gcc/doc/invoke.texi
+@@ -260,6 +260,7 @@ Objective-C and Objective-C++ Dialects}.
+ -Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol
+ -Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
+ -Wpointer-arith -Wno-pointer-to-int-cast @gol
++-Wno-poison-system-directories @gol
+ -Wredundant-decls -Wno-return-local-addr @gol
+ -Wreturn-type -Wsequence-point -Wshadow @gol
+ -Wsign-compare -Wsign-conversion -Wfloat-conversion @gol
+@@ -4230,6 +4231,14 @@ headers---for that, @option{-Wunknown-pr
+ for most targets, it is made up of code and thus requires the stack
+ to be made executable in order for the program to work properly.
+
++@item -Wno-poison-system-directories
++@opindex Wno-poison-system-directories
++Do not warn for @option{-I} or @option{-L} options using system
++directories such as @file{/usr/include} when cross compiling. This
++option is intended for use in chroot environments when such
++directories contain the correct headers and libraries for the target
++system rather than the host.
++
+ @item -Wfloat-equal
+ @opindex Wfloat-equal
+ @opindex Wno-float-equal
+Index: gcc-4.9-20140316/gcc/gcc.c
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/gcc.c
++++ gcc-4.9-20140316/gcc/gcc.c
+@@ -764,6 +764,8 @@ proper position among the other output f
+ "%{fuse-ld=*:-fuse-ld=%*}\
+ %X %{o*} %{e*} %{N} %{n} %{r}\
+ %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
++ %{Wno-poison-system-directories:--no-poison-system-directories}\
++ %{Werror=poison-system-directories:--error-poison-system-directories}\
+ %{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
+ %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
+ %{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
+Index: gcc-4.9-20140316/gcc/incpath.c
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/incpath.c
++++ gcc-4.9-20140316/gcc/incpath.c
+@@ -28,6 +28,7 @@
+ #include "intl.h"
+ #include "incpath.h"
+ #include "cppdefault.h"
++#include "diagnostic-core.h"
+
+ /* Microsoft Windows does not natively support inodes.
+ VMS has non-numeric inodes. */
+@@ -382,6 +383,24 @@ merge_include_chains (const char *sysroo
+ }
+ fprintf (stderr, _("End of search list.\n"));
+ }
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++ if (flag_poison_system_directories)
++ {
++ struct cpp_dir *p;
++
++ for (p = heads[QUOTE]; p; p = p->next)
++ {
++ if ((!strncmp (p->name, "/usr/include", 12))
++ || (!strncmp (p->name, "/usr/local/include", 18))
++ || (!strncmp (p->name, "/usr/X11R6/include", 18)))
++ warning (OPT_Wpoison_system_directories,
++ "include location \"%s\" is unsafe for "
++ "cross-compilation",
++ p->name);
++ }
++ }
++#endif
+ }
+
+ /* Use given -I paths for #include "..." but not #include <...>, and
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0017-gcc-poison-dir-extend.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0017-gcc-poison-dir-extend.patch
new file mode 100644
index 000000000..9e81efd4d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0017-gcc-poison-dir-extend.patch
@@ -0,0 +1,39 @@
+From e99c9c97266d6d3e8cac798aa91408250c4d60cf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:00:34 +0400
+Subject: [PATCH 17/35] gcc-poison-dir-extend
+
+Add /sw/include and /opt/include based on the original
+zecke-no-host-includes.patch patch. The original patch checked for
+/usr/include, /sw/include and /opt/include and then triggered a failure and
+aborted.
+
+Instead, we add the two missing items to the current scan. If the user
+wants this to be a failure, they can add "-Werror=poison-system-directories".
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/incpath.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/incpath.c b/gcc/incpath.c
+index cd41c78..eac4a92 100644
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -393,7 +393,9 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
+ {
+ if ((!strncmp (p->name, "/usr/include", 12))
+ || (!strncmp (p->name, "/usr/local/include", 18))
+- || (!strncmp (p->name, "/usr/X11R6/include", 18)))
++ || (!strncmp (p->name, "/usr/X11R6/include", 18))
++ || (!strncmp (p->name, "/sw/include", 11))
++ || (!strncmp (p->name, "/opt/include", 12)))
+ warning (OPT_Wpoison_system_directories,
+ "include location \"%s\" is unsafe for "
+ "cross-compilation",
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
new file mode 100644
index 000000000..a28cafdf9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
@@ -0,0 +1,73 @@
+From 56207fa2923e8edf774e98ffac82666091076be3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:08:31 +0400
+Subject: [PATCH 18/35] gcc-4.3.3: SYSROOT_CFLAGS_FOR_TARGET
+
+Before committing, I noticed that PR/32161 was marked as a dup of PR/32009, but my previous patch did not fix it.
+
+This alternative patch is better because it lets you just use CFLAGS_FOR_TARGET to set the compilation flags for libgcc. Since bootstrapped target libraries are never compiled with the native compiler, it makes little sense to use different flags for stage1 and later stages. And it also makes little sense to use a different variable than CFLAGS_FOR_TARGET.
+
+Other changes I had to do include:
+
+- moving the creation of default CFLAGS_FOR_TARGET from Makefile.am to configure.ac, because otherwise the BOOT_CFLAGS are substituted into CFLAGS_FOR_TARGET (which is "-O2 -g $(CFLAGS)") via $(CFLAGS). It is also cleaner this way though.
+
+- passing the right CFLAGS to configure scripts as exported environment variables
+
+I also stopped passing LIBCFLAGS to configure scripts since they are unused in the whole src tree. And I updated the documentation as H-P reminded me to do.
+
+Bootstrapped/regtested i686-pc-linux-gnu, will commit to 4.4 shortly. Ok for 4.3?
+
+Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ configure | 32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+diff --git a/configure b/configure
+index 1b76c90..e4dce7c 100755
+--- a/configure
++++ b/configure
+@@ -6772,6 +6772,38 @@ fi
+
+
+
++# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
++# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS
++# might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
++# We want to ensure that TARGET libraries (which we know are built with
++# gcc) are built with "-O2 -g", so include those options when setting
++# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
++if test "x$CFLAGS_FOR_TARGET" = x; then
++ CFLAGS_FOR_TARGET=$CFLAGS
++ case " $CFLAGS " in
++ *" -O2 "*) ;;
++ *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;;
++ esac
++ case " $CFLAGS " in
++ *" -g "* | *" -g3 "*) ;;
++ *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
++ esac
++fi
++
++
++if test "x$CXXFLAGS_FOR_TARGET" = x; then
++ CXXFLAGS_FOR_TARGET=$CXXFLAGS
++ case " $CXXFLAGS " in
++ *" -O2 "*) ;;
++ *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;;
++ esac
++ case " $CXXFLAGS " in
++ *" -g "* | *" -g3 "*) ;;
++ *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
++ esac
++fi
++
++
+ # Handle --with-headers=XXX. If the value is not "yes", the contents of
+ # the named directory are copied to $(tooldir)/sys-include.
+ if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0019-64-bit-multilib-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0019-64-bit-multilib-hack.patch
new file mode 100644
index 000000000..058be0c40
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0019-64-bit-multilib-hack.patch
@@ -0,0 +1,82 @@
+From 18fde5740b09324dfb9cf41e9849672573ff5fa0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:10:06 +0400
+Subject: [PATCH 19/35] 64-bit multilib hack.
+
+GCC has internal multilib handling code but it assumes a very specific rigid directory
+layout. The build system implementation of multilib layout is very generic and allows
+complete customisation of the library directories.
+
+This patch is a partial solution to allow any custom directories to be passed into gcc
+and handled correctly. It forces gcc to use the base_libdir (which is the current
+directory, "."). We need to do this for each multilib that is configured as we don't
+know which compiler options may be being passed into the compiler. Since we have a compiler
+per mulitlib at this point that isn't an issue.
+
+The one problem is the target compiler is only going to work for the default multlilib at
+this point. Ideally we'd figure out which multilibs were being enabled with which paths
+and be able to patch these entries with a complete set of correct paths but this we
+don't have such code at this point. This is something the target gcc recipe should do
+and override these platform defaults in its build config.
+
+RP 15/8/11
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/i386/t-linux64 | 6 ++----
+ gcc/config/mips/t-linux64 | 10 +++-------
+ gcc/config/rs6000/t-linux64 | 5 ++---
+ 3 files changed, 7 insertions(+), 14 deletions(-)
+
+Index: gcc-4.9-20140316/gcc/config/i386/t-linux64
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config/i386/t-linux64
++++ gcc-4.9-20140316/gcc/config/i386/t-linux64
+@@ -32,7 +32,5 @@
+ #
+ comma=,
+ MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
+-MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
+-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
+-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
+-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
++MULTILIB_DIRNAMES = . .
++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
+Index: gcc-4.9-20140316/gcc/config/mips/t-linux64
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config/mips/t-linux64
++++ gcc-4.9-20140316/gcc/config/mips/t-linux64
+@@ -17,10 +17,6 @@
+ # <http://www.gnu.org/licenses/>.
+
+ MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
+-MULTILIB_DIRNAMES = n32 32 64
+-MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
+-MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
+-MULTILIB_OSDIRNAMES = \
+- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
+- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
+- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
++MULTILIB_DIRNAMES = . . .
++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
++
+Index: gcc-4.9-20140316/gcc/config/rs6000/t-linux64
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config/rs6000/t-linux64
++++ gcc-4.9-20140316/gcc/config/rs6000/t-linux64
+@@ -26,10 +26,9 @@
+ # MULTILIB_OSDIRNAMES according to what is found on the target.
+
+ MULTILIB_OPTIONS := m64/m32
+-MULTILIB_DIRNAMES := 64 32
++MULTILIB_DIRNAMES := . .
+ MULTILIB_EXTRA_OPTS :=
+-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
+-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
++MULTILIB_OSDIRNAMES := ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
+
+ rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
+ $(COMPILE) $<
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0020-optional-libstdc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0020-optional-libstdc.patch
new file mode 100644
index 000000000..5b466140d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0020-optional-libstdc.patch
@@ -0,0 +1,98 @@
+From 307c8ff3ef666b7bd5ac733863f2fbb27a9d521e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:12:56 +0400
+Subject: [PATCH 20/35] optional libstdc
+
+gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++
+will not run correctly since by default the linker will try to link against libstdc++
+which shouldn't exist yet. We need an option to disable -lstdc++
+option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc
+driver. This patch adds such an option which only disables the -lstdc++.
+
+A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to
+do this officially, the likely answer is don't build libstdc++ separately.
+
+RP 29/6/10
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ gcc/c-family/c.opt | 4 ++++
+ gcc/cp/g++spec.c | 1 +
+ gcc/doc/invoke.texi | 9 +++++++--
+ gcc/gcc.c | 1 +
+ 4 files changed, 13 insertions(+), 2 deletions(-)
+
+Index: gcc-4.9-20140316/gcc/c-family/c.opt
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/c-family/c.opt
++++ gcc-4.9-20140316/gcc/c-family/c.opt
+@@ -1323,6 +1323,10 @@ nostdinc++
+ C++ ObjC++
+ Do not search standard system include directories for C++
+
++nostdlib++
++Driver
++Do not link standard C++ runtime library
++
+ o
+ C ObjC C++ ObjC++ Joined Separate
+ ; Documented in common.opt
+Index: gcc-4.9-20140316/gcc/cp/g++spec.c
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/cp/g++spec.c
++++ gcc-4.9-20140316/gcc/cp/g++spec.c
+@@ -138,6 +138,7 @@ lang_specific_driver (struct cl_decoded_
+ switch (decoded_options[i].opt_index)
+ {
+ case OPT_nostdlib:
++ case OPT_nostdlib__:
+ case OPT_nodefaultlibs:
+ library = -1;
+ break;
+Index: gcc-4.9-20140316/gcc/doc/invoke.texi
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/doc/invoke.texi
++++ gcc-4.9-20140316/gcc/doc/invoke.texi
+@@ -193,6 +193,7 @@ in the following sections.
+ -fvisibility-inlines-hidden @gol
+ -fvtable-verify=@var{std|preinit|none} @gol
+ -fvtv-counts -fvtv-debug @gol
++-nostdlib++ @gol
+ -fvisibility-ms-compat @gol
+ -fext-numeric-literals @gol
+ -Wabi -Wconversion-null -Wctor-dtor-privacy @gol
+@@ -457,7 +458,7 @@ Objective-C and Objective-C++ Dialects}.
+ -nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic @gol
+ -s -static -static-libgcc -static-libstdc++ @gol
+ -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
+--shared -shared-libgcc -symbolic @gol
++-shared -shared-libgcc -symbolic -nostdlib++ @gol
+ -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol
+ -u @var{symbol}}
+
+@@ -10285,6 +10286,11 @@ These entries are usually resolved by en
+ libc. These entry points should be supplied through some other
+ mechanism when this option is specified.
+
++@item -nostdlib++
++@opindex nostdlib++
++Do not use the standard system C++ runtime libraries when linking.
++Only the libraries you specify will be passed to the linker.
++
+ @cindex @option{-lgcc}, use with @option{-nostdlib}
+ @cindex @option{-nostdlib} and unresolved references
+ @cindex unresolved references and @option{-nostdlib}
+Index: gcc-4.9-20140316/gcc/gcc.c
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/gcc.c
++++ gcc-4.9-20140316/gcc/gcc.c
+@@ -772,6 +772,7 @@ proper position among the other output f
+ %(mflib) " STACK_SPLIT_SPEC "\
+ %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \
+ %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
++ %{!nostdlib++:}\
+ %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
+ #endif
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
new file mode 100644
index 000000000..eb3c61f12
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
@@ -0,0 +1,59 @@
+From 004696e054ae9dc71d512cc755ccc4074fc62b2d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:14:20 +0400
+Subject: [PATCH 21/35] gcc: disable MASK_RELAX_PIC_CALLS bit
+
+The new feature added after 4.3.3
+"http://www.pubbs.net/200909/gcc/94048-patch-add-support-for-rmipsjalr.html"
+will cause cc1plus eat up all the system memory when build webkit-gtk.
+The function mips_get_pic_call_symbol keeps on recursively calling itself.
+Disable this feature to walk aside the bug.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ gcc/configure | 7 -------
+ gcc/configure.ac | 7 -------
+ 2 files changed, 14 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index b65d21d..bdab45a 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -25829,13 +25829,6 @@ $as_echo_n "checking assembler and linker for explicit JALR relocation... " >&6;
+ rm -f conftest.*
+ fi
+ fi
+- if test $gcc_cv_as_ld_jalr_reloc = yes; then
+- if test x$target_cpu_default = x; then
+- target_cpu_default=MASK_RELAX_PIC_CALLS
+- else
+- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
+- fi
+- fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ld_jalr_reloc" >&5
+ $as_echo "$gcc_cv_as_ld_jalr_reloc" >&6; }
+
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index e226b85..5f5c909 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4099,13 +4099,6 @@ x:
+ rm -f conftest.*
+ fi
+ fi
+- if test $gcc_cv_as_ld_jalr_reloc = yes; then
+- if test x$target_cpu_default = x; then
+- target_cpu_default=MASK_RELAX_PIC_CALLS
+- else
+- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
+- fi
+- fi
+ AC_MSG_RESULT($gcc_cv_as_ld_jalr_reloc)
+
+ AC_CACHE_CHECK([linker for .eh_frame personality relaxation],
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0022-COLLECT_GCC_OPTIONS.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0022-COLLECT_GCC_OPTIONS.patch
new file mode 100644
index 000000000..40c8abffa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0022-COLLECT_GCC_OPTIONS.patch
@@ -0,0 +1,38 @@
+From 7f5c9dcc71c8b83a0b5596266cc4bdf0936e8e00 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:16:28 +0400
+Subject: [PATCH 22/35] COLLECT_GCC_OPTIONS
+
+This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to
+invoke collect2.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/gcc.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 477752f..51062aa 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -4098,6 +4098,15 @@ set_collect_gcc_options (void)
+ sizeof ("COLLECT_GCC_OPTIONS=") - 1);
+
+ first_time = TRUE;
++#ifdef HAVE_LD_SYSROOT
++ if (target_system_root_changed && target_system_root)
++ {
++ obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1);
++ obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root));
++ obstack_grow (&collect_obstack, "'", 1);
++ first_time = FALSE;
++ }
++#endif
+ for (i = 0; (int) i < n_switches; i++)
+ {
+ const char *const *args;
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0023-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-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
new file mode 100644
index 000000000..fddfe9e5e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
@@ -0,0 +1,96 @@
+From f7d49ca445e60faa1b5256c6b4f96c1ee5c0e353 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:17:25 +0400
+Subject: [PATCH 23/35] Use the defaults.h in ${B} instead of ${S}, and t-oe
+ in ${B}
+
+Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}, so that
+the source can be shared between gcc-cross-initial,
+gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+While compiling gcc-crosssdk-initial-x86_64 on some host, there is
+occasionally failure that test the existance of default.h doesn't
+work, the reason is tm_include_list='** defaults.h' rather than
+tm_include_list='** ./defaults.h'
+
+So we add the test condition for this situation.
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/Makefile.in | 2 +-
+ gcc/configure | 4 ++--
+ gcc/configure.ac | 4 ++--
+ gcc/mkconfig.sh | 4 ++--
+ 4 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index d1ab22f..15fe4b6 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -483,7 +483,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
+ TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
+
+ xmake_file=@xmake_file@
+-tmake_file=@tmake_file@
++tmake_file=@tmake_file@ ./t-oe
+ TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@
+ TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
+ TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
+diff --git a/gcc/configure b/gcc/configure
+index 5399b2b..60a04bd 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11631,8 +11631,8 @@ for f in $tm_file; do
+ tm_include_list="${tm_include_list} $f"
+ ;;
+ defaults.h )
+- tm_file_list="${tm_file_list} \$(srcdir)/$f"
+- tm_include_list="${tm_include_list} $f"
++ tm_file_list="${tm_file_list} ./$f"
++ tm_include_list="${tm_include_list} ./$f"
+ ;;
+ * )
+ tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index f87c3b6..460e0d9 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1740,8 +1740,8 @@ for f in $tm_file; do
+ tm_include_list="${tm_include_list} $f"
+ ;;
+ defaults.h )
+- tm_file_list="${tm_file_list} \$(srcdir)/$f"
+- tm_include_list="${tm_include_list} $f"
++ tm_file_list="${tm_file_list} ./$f"
++ tm_include_list="${tm_include_list} ./$f"
+ ;;
+ * )
+ tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
+index c7146ed..b153f45 100644
+--- a/gcc/mkconfig.sh
++++ b/gcc/mkconfig.sh
+@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then
+ if [ $# -ge 1 ]; then
+ echo '#ifdef IN_GCC' >> ${output}T
+ for file in "$@"; do
+- if test x"$file" = x"defaults.h"; then
++ if test x"$file" = x"./defaults.h" -o x"$file" = x"defaults.h"; then
+ postpone_defaults_h="yes"
+ else
+ echo "# include \"$file\"" >> ${output}T
+@@ -106,7 +106,7 @@ esac
+
+ # If we postponed including defaults.h, add the #include now.
+ if test x"$postpone_defaults_h" = x"yes"; then
+- echo "# include \"defaults.h\"" >> ${output}T
++ echo "# include \"./defaults.h\"" >> ${output}T
+ fi
+
+ # Add multiple inclusion protection guard, part two.
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0025-fortran-cross-compile-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0025-fortran-cross-compile-hack.patch
new file mode 100644
index 000000000..0e7914d5c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0025-fortran-cross-compile-hack.patch
@@ -0,0 +1,46 @@
+From af8a56ea4e17b2909eff2c57704ab43ef24f28d3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:20:01 +0400
+Subject: [PATCH 25/35] fortran cross-compile hack.
+
+* Fortran would have searched for arm-angstrom-gnueabi-gfortran but would have used
+used gfortan. For gcc_4.2.2.bb we want to use the gfortran compiler from our cross
+directory.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ libgfortran/configure | 2 +-
+ libgfortran/configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgfortran/configure b/libgfortran/configure
+index 8385e96..b8f7a92 100755
+--- a/libgfortran/configure
++++ b/libgfortran/configure
+@@ -12704,7 +12704,7 @@ esac
+
+ # We need gfortran to compile parts of the library
+ #AC_PROG_FC(gfortran)
+-FC="$GFORTRAN"
++#FC="$GFORTRAN"
+ ac_ext=${ac_fc_srcext-f}
+ ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
+index 7d97fed..3f9f484 100644
+--- a/libgfortran/configure.ac
++++ b/libgfortran/configure.ac
+@@ -227,7 +227,7 @@ AC_SUBST(enable_static)
+
+ # We need gfortran to compile parts of the library
+ #AC_PROG_FC(gfortran)
+-FC="$GFORTRAN"
++#FC="$GFORTRAN"
+ AC_PROG_FC(gfortran)
+
+ # extra LD Flags which are required for targets
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0026-libgcc-sjlj-check.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0026-libgcc-sjlj-check.patch
new file mode 100644
index 000000000..d4efab956
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0026-libgcc-sjlj-check.patch
@@ -0,0 +1,74 @@
+From 08c2398445e6cac282488f64ae6bf29cbcd8db23 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:20:50 +0400
+Subject: [PATCH 26/35] libgcc-sjlj-check
+
+ac_fn_c_try_compile doesnt seem to keep the intermediate files
+which are needed for sjlj test to pass since it greps into the
+generated file. So we run the compiler command using AC_TRY_COMMAND
+which then generates the needed .s file
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libgcc/configure | 10 ++++++----
+ libgcc/configure.ac | 10 ++++------
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/libgcc/configure b/libgcc/configure
+index 1425df6..d18e3cb 100644
+--- a/libgcc/configure
++++ b/libgcc/configure
+@@ -4208,17 +4208,19 @@ void foo ()
+ }
+
+ _ACEOF
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-if ac_fn_c_try_compile; then :
++if { ac_try='${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&5'
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; }; then
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=no
+ fi
+ fi
+-CFLAGS=$CFLAGS_hold
+ rm -f conftest*
+
+ fi
+diff --git a/libgcc/configure.ac b/libgcc/configure.ac
+index 8b7aba5..c7c9644 100644
+--- a/libgcc/configure.ac
++++ b/libgcc/configure.ac
+@@ -216,16 +216,14 @@ void foo ()
+ bar();
+ }
+ ])])
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-AS_IF([ac_fn_c_try_compile],
+- [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
++if AC_TRY_COMMAND(${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
++ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=no
+- fi])
+-CFLAGS=$CFLAGS_hold
++ fi
++fi
+ rm -f conftest*
+ ])
+
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0027-cpp-honor-sysroot.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0027-cpp-honor-sysroot.patch
new file mode 100644
index 000000000..05e95219f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0027-cpp-honor-sysroot.patch
@@ -0,0 +1,54 @@
+From a0f9bd09c816ad29ecf7c29d6c27f7df97710364 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:22:00 +0400
+Subject: [PATCH 27/35] cpp: honor sysroot.
+
+Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile
+preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location
+rather than the --sysroot option specified on the commandline. If access to that directory is
+permission denied (unreadable), gcc will error.
+
+This happens when ccache is in use due to the fact it uses preprocessed source files.
+
+The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix,
+-isystem, -isysroot happen and the correct sysroot is used.
+
+[YOCTO #2074]
+
+RP 2012/04/13
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/cp/lang-specs.h | 2 +-
+ gcc/gcc.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
+index a001c3e..1aae1e4 100644
+--- a/gcc/cp/lang-specs.h
++++ b/gcc/cp/lang-specs.h
+@@ -63,5 +63,5 @@ along with GCC; see the file COPYING3. If not see
+ {".ii", "@c++-cpp-output", 0, 0, 0},
+ {"@c++-cpp-output",
+ "%{!M:%{!MM:%{!E:\
+- cc1plus -fpreprocessed %i %(cc1_options) %2\
++ cc1plus -fpreprocessed %i %I %(cc1_options) %2\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 51062aa..cf6b99e 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1042,7 +1042,7 @@ static const struct compiler default_compilers[] =
+ %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0},
+ {".i", "@cpp-output", 0, 0, 0},
+ {"@cpp-output",
+- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
++ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ {".s", "@assembler", 0, 0, 0},
+ {"@assembler",
+ "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0028-MIPS64-Default-to-N64-ABI.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0028-MIPS64-Default-to-N64-ABI.patch
new file mode 100644
index 000000000..263872069
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0028-MIPS64-Default-to-N64-ABI.patch
@@ -0,0 +1,31 @@
+From 301e18d4711db5925e767fad08dffa9cfe0a2f1f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:23:08 +0400
+Subject: [PATCH 28/35] MIPS64: Default to N64 ABI
+
+MIPS64 defaults to n32 ABI, this patch makes it
+so that it defaults to N64 ABI
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE config specific]
+---
+ gcc/config.gcc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index 1a0be50..989c2fb 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -1797,7 +1797,7 @@ mips*-mti-linux*)
+ mips64*-*-linux* | mipsisa64*-*-linux*)
+ tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h mips/linux-common.h"
+ tmake_file="${tmake_file} mips/t-linux64"
+- tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
++ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_64"
+ case ${target} in
+ mips64el-st-linux-gnu)
+ tm_file="${tm_file} mips/st.h"
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
new file mode 100644
index 000000000..969d290ad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
@@ -0,0 +1,228 @@
+From 29d12344fb682a053de53eb08b95704cf3b67af2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:24:50 +0400
+Subject: [PATCH 29/35] Define GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
+ relative to SYSTEMLIBS_DIR
+
+This patch defines GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
+relative to SYSTEMLIBS_DIR which can be set in generated headers
+This breaks the assumption of hardcoded multilib in gcc
+Change is only for the supported architectures in OE including
+SH, sparc, alpha for possible future support (if any)
+
+Removes the do_headerfix task in metadata
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE configuration]
+---
+ gcc/config/alpha/linux-elf.h | 4 ++--
+ gcc/config/arm/linux-eabi.h | 4 ++--
+ gcc/config/arm/linux-elf.h | 2 +-
+ gcc/config/i386/linux.h | 2 +-
+ gcc/config/i386/linux64.h | 6 +++---
+ gcc/config/mips/linux.h | 2 +-
+ gcc/config/mips/linux64.h | 8 ++++----
+ gcc/config/rs6000/linux64.h | 8 ++++----
+ gcc/config/sh/linux.h | 2 +-
+ gcc/config/sparc/linux.h | 2 +-
+ gcc/config/sparc/linux64.h | 4 ++--
+ 11 files changed, 22 insertions(+), 22 deletions(-)
+
+Index: gcc-4.9.0/gcc/config/alpha/linux-elf.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/alpha/linux-elf.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/alpha/linux-elf.h 2014-05-07 16:43:50.605106535 +0000
+@@ -23,8 +23,8 @@
+ #define EXTRA_SPECS \
+ { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
++#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+Index: gcc-4.9.0/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/arm/linux-eabi.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/arm/linux-eabi.h 2014-05-07 16:43:50.605106535 +0000
+@@ -68,8 +68,8 @@
+ GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */
+
+ #undef GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
+-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
++#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT SYSTEMLIBS_DIR "ld-linux.so.3"
++#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT SYSTEMLIBS_DIR "ld-linux-armhf.so.3"
+ #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
+
+ #define GLIBC_DYNAMIC_LINKER \
+Index: gcc-4.9.0/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/arm/linux-elf.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/arm/linux-elf.h 2014-05-07 16:43:50.605106535 +0000
+@@ -57,7 +57,7 @@
+
+ #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+
+ #define LINUX_TARGET_LINK_SPEC "%{h*} \
+ %{static:-Bstatic} \
+Index: gcc-4.9.0/gcc/config/i386/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/i386/linux.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/i386/linux.h 2014-05-07 16:43:50.605106535 +0000
+@@ -20,4 +20,4 @@
+ <http://www.gnu.org/licenses/>. */
+
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+Index: gcc-4.9.0/gcc/config/i386/linux64.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/i386/linux64.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/i386/linux64.h 2014-05-07 16:43:50.605106535 +0000
+@@ -27,6 +27,6 @@
+ #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
+ #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
+-#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2"
+Index: gcc-4.9.0/gcc/config/mips/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/mips/linux.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/mips/linux.h 2014-05-07 16:43:50.605106535 +0000
+@@ -18,8 +18,8 @@
+ <http://www.gnu.org/licenses/>. */
+
+ #define GLIBC_DYNAMIC_LINKER \
+- "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+
+ #undef UCLIBC_DYNAMIC_LINKER
+ #define UCLIBC_DYNAMIC_LINKER \
+- "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+Index: gcc-4.9.0/gcc/config/mips/linux64.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/mips/linux64.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/mips/linux64.h 2014-05-07 16:43:50.605106535 +0000
+@@ -23,20 +23,20 @@
+ #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
+
+ #define GLIBC_DYNAMIC_LINKER32 \
+- "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ #define GLIBC_DYNAMIC_LINKER64 \
+- "%{mnan=2008:/lib64/ld-linux-mipsn8.so.1;:/lib64/ld.so.1}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ #define GLIBC_DYNAMIC_LINKERN32 \
+- "%{mnan=2008:/lib32/ld-linux-mipsn8.so.1;:/lib32/ld.so.1}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+
+ #undef UCLIBC_DYNAMIC_LINKER32
+ #define UCLIBC_DYNAMIC_LINKER32 \
+- "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+ #undef UCLIBC_DYNAMIC_LINKER64
+ #define UCLIBC_DYNAMIC_LINKER64 \
+- "%{mnan=2008:/lib/ld64-uClibc-mipsn8.so.0;:/lib/ld64-uClibc.so.0}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld64-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld64-uClibc.so.0}"
+ #define UCLIBC_DYNAMIC_LINKERN32 \
+- "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+Index: gcc-4.9.0/gcc/config/rs6000/linux64.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/rs6000/linux64.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/rs6000/linux64.h 2014-05-07 16:43:50.605106535 +0000
+@@ -367,14 +367,14 @@
+ #undef LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1"
+ #ifdef LINUX64_DEFAULT_ABI_ELFv2
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/lib64/ld64.so.2}"
++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:" SYSTEMLIBS_DIR "ld64.so.1;:" SYSTEMLIBS_DIR "ld64.so.2}"
+ #else
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/lib64/ld64.so.2;:/lib64/ld64.so.1}"
++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:" SYSTEMLIBS_DIR "ld64.so.2;:" SYSTEMLIBS_DIR "ld64.so.1}"
+ #endif
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+Index: gcc-4.9.0/gcc/config/sh/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/sh/linux.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/sh/linux.h 2014-05-07 16:43:50.605106535 +0000
+@@ -43,7 +43,7 @@
+
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+ #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
+Index: gcc-4.9.0/gcc/config/sparc/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/sparc/linux.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/sparc/linux.h 2014-05-07 16:43:50.605106535 +0000
+@@ -83,7 +83,7 @@
+ When the -shared link option is used a final link is not being
+ done. */
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
+Index: gcc-4.9.0/gcc/config/sparc/linux64.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/sparc/linux64.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/sparc/linux64.h 2014-05-07 16:43:50.605106535 +0000
+@@ -92,8 +92,8 @@
+ When the -shared link option is used a final link is not being
+ done. */
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux.so.2"
+
+ #ifdef SPARC_BI_ARCH
+
+Index: gcc-4.9.0/gcc/config/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/linux.h 2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/linux.h 2014-05-07 16:43:50.605106535 +0000
+@@ -73,10 +73,10 @@
+ GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
+ GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
+ supporting both 32-bit and 64-bit compilation. */
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKERX32 "/lib/ldx32-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ldx32-uClibc.so.0"
+ #define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0030-gcc-Fix-argument-list-too-long-error.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0030-gcc-Fix-argument-list-too-long-error.patch
new file mode 100644
index 000000000..2ceaff64f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0030-gcc-Fix-argument-list-too-long-error.patch
@@ -0,0 +1,40 @@
+From c1816c160156f99c34e6a0a0311bb0219326804e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:26:37 +0400
+Subject: [PATCH 30/35] gcc: Fix argument list too long error.
+
+There would be an "Argument list too long" error when the
+build directory is longer than 200, this is caused by:
+
+headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`
+
+The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle
+it, use the $(sort list) of GNU make which can handle the too long list
+would fix the problem, the header would be short enough after sorted.
+The "tr ' ' '\012'" was used for translating the space to "\n", the
+$(sort list) doesn't need this.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 2320497..8562a62 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -4627,7 +4627,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
+ # We keep the directory structure for files in config or c-family and .def
+ # files. All other files are flattened to a single directory.
+ $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
+- headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`; \
++ headers="$(sort $(PLUGIN_HEADERS))"; \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
+ for file in $$headers; do \
+ if [ -f $$file ] ; then \
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0031-Disable-sdt.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0031-Disable-sdt.patch
new file mode 100644
index 000000000..2c1d5e086
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0031-Disable-sdt.patch
@@ -0,0 +1,113 @@
+From b85265bc94ec1beaf1d3b697c03db62991553467 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:28:10 +0400
+Subject: [PATCH 31/35] Disable sdt.
+
+We don't list dtrace in DEPENDS so we shouldn't be depending on this header.
+It may or may not exist from preivous builds though. To be determinstic, disable
+sdt.h usage always. This avoids build failures if the header is removed after configure
+but before libgcc is compiled for example.
+
+RP 2012/8/7
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Disable sdt for libstdc++-v3.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Upstream-Status: Inappropriate [hack]
+---
+ gcc/configure | 12 ++++++------
+ gcc/configure.ac | 18 +++++++++---------
+ libstdc++-v3/configure | 6 +++---
+ libstdc++-v3/configure.ac | 2 +-
+ 4 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 3c550a6..01c7626 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -26812,12 +26812,12 @@ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
+ $as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
+ have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+- have_sys_sdt_h=yes
+-
+-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+-
+-fi
++#if test -f $target_header_dir/sys/sdt.h; then
++# have_sys_sdt_h=yes
++#
++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
++#
++#fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
+ $as_echo "$have_sys_sdt_h" >&6; }
+
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 3601ab6..06e501f 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4779,15 +4779,15 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then
+ fi
+
+ # Test for <sys/sdt.h> on the target.
+-GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
+-AC_MSG_CHECKING(sys/sdt.h in the target C library)
+-have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+- have_sys_sdt_h=yes
+- AC_DEFINE(HAVE_SYS_SDT_H, 1,
+- [Define if your target C library provides sys/sdt.h])
+-fi
+-AC_MSG_RESULT($have_sys_sdt_h)
++#GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
++#AC_MSG_CHECKING(sys/sdt.h in the target C library)
++#have_sys_sdt_h=no
++#if test -f $target_header_dir/sys/sdt.h; then
++# have_sys_sdt_h=yes
++# AC_DEFINE(HAVE_SYS_SDT_H, 1,
++# [Define if your target C library provides sys/sdt.h])
++#fi
++#AC_MSG_RESULT($have_sys_sdt_h)
+
+ # Check if TFmode long double should be used by default or not.
+ # Some glibc targets used DFmode long double, but with glibc 2.4
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index 4953c9f..53a1145 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -20578,11 +20578,11 @@ 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_compiler_gnu=$ac_cv_c_compiler_gnu
+
+- if test $glibcxx_cv_sys_sdt_h = yes; then
++# if test $glibcxx_cv_sys_sdt_h = yes; then
+
+-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+
+- fi
++# fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_sys_sdt_h" >&5
+ $as_echo "$glibcxx_cv_sys_sdt_h" >&6; }
+
+diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
+index 73d430a..f2135e2 100644
+--- a/libstdc++-v3/configure.ac
++++ b/libstdc++-v3/configure.ac
+@@ -211,7 +211,7 @@ GLIBCXX_CHECK_SC_NPROCESSORS_ONLN
+ GLIBCXX_CHECK_SC_NPROC_ONLN
+ GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP
+ GLIBCXX_CHECK_SYSCTL_HW_NCPU
+-GLIBCXX_CHECK_SDT_H
++#GLIBCXX_CHECK_SDT_H
+
+ # Check for available headers.
+ AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0032-libtool.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0032-libtool.patch
new file mode 100644
index 000000000..3b3d1b621
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0032-libtool.patch
@@ -0,0 +1,42 @@
+From 6c715fcfa262adadca81c68a1f3f69aa3187a501 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:29:11 +0400
+Subject: [PATCH 32/35] libtool
+
+libstdc++ from gcc-runtime gets created with -rpath=/usr/lib/../lib for qemux86-64
+when running on am x86_64 build host.
+
+This patch stops this speading to libdir in the libstdc++.la file within libtool.
+Arguably, it shouldn't be passing this into libtool in the first place but
+for now this resolves the nastiest problems this causes.
+
+func_normal_abspath would resolve an empty path to `pwd` so we need
+to filter the zero case.
+
+RP 2012/8/24
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ ltmain.sh | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index a03433f..46f47c2 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -6359,6 +6359,10 @@ func_mode_link ()
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
++ if test -n "$install_libdir"; then
++ func_normal_abspath "$install_libdir"
++ install_libdir=$func_normal_abspath_result
++ fi
+
+ oldlibs=
+ if test -z "$rpath"; then
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
new file mode 100644
index 000000000..b236c37a5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
@@ -0,0 +1,40 @@
+From 97e4591c20310425e7aca0e6712a8d9480e7744c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:30:32 +0400
+Subject: [PATCH 33/35] gcc: armv4: pass fix-v4bx to linker to support EABI.
+
+The LINK_SPEC for linux gets overwritten by linux-eabi.h which
+means the value of TARGET_FIX_V4BX_SPEC gets lost and as a result
+the option is not passed to linker when chosing march=armv4
+This patch redefines this in linux-eabi.h and reinserts it
+for eabi defaulting toolchains.
+
+We might want to send it upstream.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/arm/linux-eabi.h | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+Index: gcc-4.9-20140316/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config/arm/linux-eabi.h
++++ gcc-4.9-20140316/gcc/config/arm/linux-eabi.h
+@@ -77,10 +77,14 @@
+ %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
+ %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
+
++/* For armv4 we pass --fix-v4bx to linker to support EABI */
++#undef TARGET_FIX_V4BX_SPEC
++#define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}"
++
+ /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
+ use the GNU/Linux version, not the generic BPABI version. */
+ #undef LINK_SPEC
+-#define LINK_SPEC EABI_LINK_SPEC \
++#define LINK_SPEC TARGET_FIX_V4BX_SPEC EABI_LINK_SPEC \
+ LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
+ LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch
new file mode 100644
index 000000000..66b9f89a1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch
@@ -0,0 +1,102 @@
+From fc5e4beaea856a2b486c770ad3addc0f5bb3100e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:33:04 +0400
+Subject: [PATCH 34/35] Use the multilib config files from ${B} instead of
+ using the ones from ${S}
+
+Use the multilib config files from ${B} instead of using the ones from ${S}
+so that the source can be shared between gcc-cross-initial,
+gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ gcc/configure | 22 ++++++++++++++++++----
+ gcc/configure.ac | 22 ++++++++++++++++++----
+ 2 files changed, 36 insertions(+), 8 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 8bc0c98..3cd0817 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11519,10 +11519,20 @@ done
+ tmake_file_=
+ for f in ${tmake_file}
+ do
+- if test -f ${srcdir}/config/$f
+- then
+- tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
+- fi
++ case $f in
++ */t-linux64 )
++ if test -f ./config/$f
++ then
++ tmake_file_="${tmake_file_} ./config/$f"
++ fi
++ ;;
++ * )
++ if test -f ${srcdir}/config/$f
++ then
++ tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
++ fi
++ ;;
++ esac
+ done
+ tmake_file="${tmake_file_}"
+
+@@ -11533,6 +11543,10 @@ tm_file_list="options.h"
+ tm_include_list="options.h insn-constants.h"
+ for f in $tm_file; do
+ case $f in
++ */linux64.h )
++ tm_file_list="${tm_file_list} ./config/$f"
++ tm_include_list="${tm_include_list} ./config/$f"
++ ;;
+ ./* )
+ f=`echo $f | sed 's/^..//'`
+ tm_file_list="${tm_file_list} $f"
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 5e5e84f..415a6df 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1700,10 +1700,20 @@ done
+ tmake_file_=
+ for f in ${tmake_file}
+ do
+- if test -f ${srcdir}/config/$f
+- then
+- tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
+- fi
++ case $f in
++ */t-linux64 )
++ if test -f ./config/$f
++ then
++ tmake_file_="${tmake_file_} ./config/$f"
++ fi
++ ;;
++ * )
++ if test -f ${srcdir}/config/$f
++ then
++ tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
++ fi
++ ;;
++ esac
+ done
+ tmake_file="${tmake_file_}"
+
+@@ -1714,6 +1724,10 @@ tm_file_list="options.h"
+ tm_include_list="options.h insn-constants.h"
+ for f in $tm_file; do
+ case $f in
++ */linux64.h )
++ tm_file_list="${tm_file_list} ./config/$f"
++ tm_include_list="${tm_include_list} ./config/$f"
++ ;;
+ ./* )
+ f=`echo $f | sed 's/^..//'`
+ tm_file_list="${tm_file_list} $f"
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0040-fix-g++-sysroot.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0040-fix-g++-sysroot.patch
new file mode 100644
index 000000000..d50aa5c9b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0040-fix-g++-sysroot.patch
@@ -0,0 +1,40 @@
+Portions of
+
+http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg26013.html
+
+are not upstreamed yet. So lets keep missing pieces.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: gcc-4.8.1/gcc/configure.ac
+===================================================================
+--- gcc-4.8.1.orig/gcc/configure.ac 2013-07-15 15:55:49.488399132 -0700
++++ gcc-4.8.1/gcc/configure.ac 2013-07-15 16:02:31.772406679 -0700
+@@ -148,7 +148,9 @@
+ if test "${with_sysroot+set}" = set; then
+ gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+ if test "${gcc_gxx_without_sysroot}"; then
+- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ if test x${with_sysroot} != x/; then
++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ fi
+ gcc_gxx_include_dir_add_sysroot=1
+ fi
+ fi
+Index: gcc-4.8.1/gcc/configure
+===================================================================
+--- gcc-4.8.1.orig/gcc/configure 2013-07-15 15:55:49.472399132 -0700
++++ gcc-4.8.1/gcc/configure 2013-07-15 16:02:31.780406680 -0700
+@@ -3325,7 +3325,9 @@
+ if test "${with_sysroot+set}" = set; then
+ gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+ if test "${gcc_gxx_without_sysroot}"; then
+- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ if test x${with_sysroot} != x/; then
++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ fi
+ gcc_gxx_include_dir_add_sysroot=1
+ fi
+ fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0041-libtool-avoid-libdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0041-libtool-avoid-libdir.patch
new file mode 100644
index 000000000..2dd9610a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0041-libtool-avoid-libdir.patch
@@ -0,0 +1,19 @@
+Avoid using libdir from .la which usually points to a host path
+
+Upstream-Status: Inappropriate [embedded specific]
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+
+diff --git a/ltmain.sh b/ltmain.sh
+index a03433f..1902a90 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -5628,6 +5628,9 @@ func_mode_link ()
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
++ # Instead of using libdir from .la which usually points to a host path,
++ # use the path the .la is contained in.
++ libdir="$abs_ladir"
+ dir="$libdir"
+ absdir="$libdir"
+ fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0043-cpp.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0043-cpp.patch
new file mode 100644
index 000000000..eaf8646f9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0043-cpp.patch
@@ -0,0 +1,40 @@
+The OE environment sets and exports CPP as being the target gcc. When building
+gcc-cross-canadian for a mingw targetted sdk, the following can be found in
+build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log:
+
+configure:3641: checking for _FILE_OFFSET_BITS value needed for large files
+configure:3666: gcc -c -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe conftest.c >&5
+configure:3666: $? = 0
+configure:3698: result: no
+configure:3786: checking how to run the C preprocessor
+configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32
+configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 conftest.c
+configure:3876: $? = 0
+
+Note this is a *build* target (in build-x86_64-linux) so it should be using
+the host "gcc", not x86_64-pokysdk-mingw32-gcc. Since the mingw32 headers are
+very different, using the wrong cpp is a real problem. It is leaking into
+configure through the CPP variable. Ultimately this leads to build failures
+related to not being able to include a process.h file for pem-unix.c.
+
+The fix is to ensure we export a sane CPP value into the build environment when
+using build targets. We could define a CPP_FOR_BUILD value which may be the version
+which needs to be upstreamed but for now, this fix is good enough to avoid the
+problem.
+
+RP 22/08/2013
+
+Upstream-Status: Pending
+
+Index: gcc-4.8.1/Makefile.in
+===================================================================
+--- gcc-4.8.1.orig/Makefile.in 2013-03-30 11:25:03.000000000 +0000
++++ gcc-4.8.1/Makefile.in 2013-08-13 12:03:17.151988882 +0000
+@@ -149,6 +149,7 @@
+ AR="$(AR_FOR_BUILD)"; export AR; \
+ AS="$(AS_FOR_BUILD)"; export AS; \
+ CC="$(CC_FOR_BUILD)"; export CC; \
++ CPP="$(CC_FOR_BUILD) -E"; export CPP; \
+ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+ CXX="$(CXX_FOR_BUILD)"; export CXX; \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0044-gengtypes.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0044-gengtypes.patch
new file mode 100644
index 000000000..e38761d4c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0044-gengtypes.patch
@@ -0,0 +1,97 @@
+gengtype is generated for both the build system and the target. -DGENERATOR_FILE
+was added in the patch http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00273.html
+and was applied to both versions of gengtype.
+
+Unfortunately the presence of this flag triggers the build configuration (bconfig.h)
+to be included for the target build of gengtype. Compiling gengtype with the target
+compiler and bconfig.h can result in errors if the build and target systems are
+dissimilar. An example case this fails is cross compiling gcc on linux for a darwin
+target system:
+
+In file included from /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c:25:0:
+| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c: In function 'void parse_error(const char*, ...)':
+| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/system.h:93:53: error: 'fputc_unlocked' was not declared in this scope
+| # define fputc(C, Stream) fputc_unlocked (C, Stream)
+
+which occurs since auto-build.h and auto-host.h have differnet values of
+HAVE_FPUTC_UNLOCKED:
+
+#define HAVE_FPUTC_UNLOCKED 1
+/* #undef HAVE_FPUTS_UNLOCKED */
+
+The obvious fix is to only include the flag on build/ targets which this patch does, however
+this also leads to compile errors due to const_tree being undefined but used in double_int.h
+
+I added a GENERATOR_FILE2 flag to workaround those in the
+target case and allow the build to succeed.
+
+Only the build/gengtypes should have the -DGENERATOR_FILE
+
+RP 22/8/2013
+
+Upstream-Status: Pending
+
+Index: gcc-4.8.1/gcc/Makefile.in
+===================================================================
+--- gcc-4.8.1.orig/gcc/Makefile.in 2013-08-19 11:40:36.844014424 +0000
++++ gcc-4.8.1/gcc/Makefile.in 2013-08-19 11:40:37.784014402 +0000
+@@ -3903,27 +3903,29 @@
+
+ gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H)
+ gengtype-lex.o: $(CONFIG_H) $(BCONFIG_H)
+-CFLAGS-gengtype-lex.o += -DGENERATOR_FILE
++CFLAGS-build/gengtype-lex.o += -DGENERATOR_FILE
+ build/gengtype-lex.o: $(BCONFIG_H)
+
+ gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
+ $(SYSTEM_H)
+ gengtype-parse.o: $(CONFIG_H)
+-CFLAGS-gengtype-parse.o += -DGENERATOR_FILE
++CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE
+ build/gengtype-parse.o: $(BCONFIG_H)
+
+ gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
+ gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
+ $(XREGEX_H)
+ gengtype-state.o: $(CONFIG_H)
+-CFLAGS-gengtype-state.o += -DGENERATOR_FILE
++CFLAGS-gengtype-state.o += -DGENERATOR_FILE2
++CFLAGS-build/gengtype-state.o += -DGENERATOR_FILE
+ build/gengtype-state.o: $(BCONFIG_H)
+
+ gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h \
+ rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \
+ $(OBSTACK_H) $(XREGEX_H)
+ gengtype.o: $(CONFIG_H)
+-CFLAGS-gengtype.o += -DGENERATOR_FILE
++CFLAGS-gengtype.o += -DGENERATOR_FILE2
++CFLAGS-build/gengtype.o += -DGENERATOR_FILE
+ build/gengtype.o: $(BCONFIG_H)
+
+ build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
+@@ -3988,7 +3990,7 @@
+ # any system header is included.
+ gengtype-lex.c : gengtype-lex.l
+ -$(FLEX) $(FLEXFLAGS) -o$@ $< && { \
+- echo '#include "bconfig.h"' > $@.tmp; \
++ echo '' > $@.tmp; \
+ cat $@ >> $@.tmp; \
+ mv $@.tmp $@; \
+ }
+Index: gcc-4.8.1/gcc/double-int.h
+===================================================================
+--- gcc-4.8.1.orig/gcc/double-int.h 2013-01-30 11:04:30.000000000 +0000
++++ gcc-4.8.1/gcc/double-int.h 2013-08-19 11:41:51.564012719 +0000
+@@ -448,10 +448,12 @@
+
+
+ #ifndef GENERATOR_FILE
++#ifndef GENERATOR_FILE2
+ /* Conversion to and from GMP integer representations. */
+
+ void mpz_set_double_int (mpz_t, double_int, bool);
+ double_int mpz_get_double_int (const_tree, mpz_t, bool);
+ #endif
++#endif
+
+ #endif /* DOUBLE_INT_H */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0046-libatomic-deptracking.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0046-libatomic-deptracking.patch
new file mode 100644
index 000000000..6ea4f4276
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0046-libatomic-deptracking.patch
@@ -0,0 +1,41 @@
+gcc 4.8 won't build with --disable-dependency-tracking since the *.Ppo files
+don't get created unless --enable-dependency-tracking is true.
+
+This patch ensures we only use those compiler options when its enabled.
+
+Upstream-Status: Submitted
+
+(Problem was already reported upstream, attached this patch there
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55930)
+
+RP
+2012/09/22
+
+Index: gcc-4.8.1/libatomic/Makefile.am
+===================================================================
+--- gcc-4.8.1.orig/libatomic/Makefile.am 2013-01-14 18:16:23.000000000 +0000
++++ gcc-4.8.1/libatomic/Makefile.am 2013-09-22 10:38:18.904064750 +0000
+@@ -100,7 +100,8 @@
+ IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
+ IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
+
+-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_FALSE@M_DEPS =
+ M_SIZE = -DN=$(PAT_N)
+ M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
+ M_FILE = $(PAT_BASE)_n.c
+Index: gcc-4.8.1/libatomic/Makefile.in
+===================================================================
+--- gcc-4.8.1.orig/libatomic/Makefile.in 2013-05-31 09:09:26.000000000 +0000
++++ gcc-4.8.1/libatomic/Makefile.in 2013-09-22 10:40:42.520059917 +0000
+@@ -298,7 +298,8 @@
+ PAT_S = $(word 3,$(PAT_SPLIT))
+ IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
+ IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
+-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_FALSE@M_DEPS =
+ M_SIZE = -DN=$(PAT_N)
+ M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
+ M_FILE = $(PAT_BASE)_n.c
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0047-repomembug.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0047-repomembug.patch
new file mode 100644
index 000000000..9afd55cbd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0047-repomembug.patch
@@ -0,0 +1,53 @@
+When compiling a project using -frepo, .rpo files are written alongside
+the .o file, the symbols either have O or C against them. During final linking,
+the objects can be recompiled with some of the entries tweaked/chosen by the
+tlink.c code (visible with TLINK_VERBOSE=3), it does this by changing O -> C
+in the .rpo files.
+
+My tests showed that init_repo (cp/repo.c) was correctly calling
+IDENTIFIER_REPO_CHOSEN against the right identifers and setting the
+chosen bit.
+
+By the time finish_repo() or emit_repo_p() were called, the pointer returned
+by get_identifier() for the symbol marked during init_repo had changed and
+the chosen bit was no longer set. This lead to linking bugs like:
+
+collect: relinking
+collect2: error: '_ZNK6sudoku5ClearINS_8SequenceEEclERS1_' was assigned to 'board.rpo', but was not defined during recompilation, or vice versa
+
+The problem is that the garbage collection is getting called before
+finish_repo() is called and ggc_protect_identifiers is set to false
+so the identifiers are not preserved. They are recreated but the
+chosen bits get wiped out which is why the pointer changes and the
+chosen bit is not set.
+
+The fix is to change ggc_protect_identifiers *after* the finish_repo
+calls are made.
+
+Reproduction is tricky since you need to trigger the garbage collector at
+just the right moment.
+
+RP 2013/10/9
+
+[YOCTO #5133]
+
+Upstream-Status: Pending
+
+Index: gcc-4.8.1/gcc/toplev.c
+===================================================================
+--- gcc-4.8.1.orig/gcc/toplev.c 2013-03-28 08:29:51.000000000 +0000
++++ gcc-4.8.1/gcc/toplev.c 2013-10-09 20:27:17.089228023 +0000
+@@ -551,11 +551,11 @@
+ if (flag_syntax_only || flag_wpa)
+ return;
+
+- ggc_protect_identifiers = false;
+-
+ /* This must also call finalize_compilation_unit. */
+ lang_hooks.decls.final_write_globals ();
+
++ ggc_protect_identifiers = false;
++
+ if (seen_error ())
+ return;
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
new file mode 100644
index 000000000..b98f8ff01
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
@@ -0,0 +1,42 @@
+From 9e0e19eac2562f73858602fe26e2044eb8b20c47 Mon Sep 17 00:00:00 2001
+From: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
+Date: Wed, 5 Feb 2014 16:52:31 +0200
+Subject: [PATCH] Enable SPE & AltiVec generation on powepc*linux target
+
+When is configured with --target=powerpc-linux, the resulting GCC will
+not be able to generate code for SPE targets (e500v1/v2).
+GCC configured with --target=powerpc-linuxspe will not be able to
+generate AltiVec instructions (for e6500).
+This patch modifies the configured file such that SPE or AltiVec code
+can be generated when gcc is configured with --target=powerpc-linux.
+The ABI and speciffic instructions can be selected through the
+"-mabi=spe or -mabi=altivec" and the "-mspe or -maltivec" parameters.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
+---
+ gcc/config.gcc | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index cb7a94e..d392c2b 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -2068,7 +2068,12 @@ powerpc-*-rtems*)
+ tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm"
+ ;;
+ powerpc*-*-linux*)
+- tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h"
++ case ${target} in
++ powerpc*-*-linux*spe* | powerpc*-*-linux*altivec*)
++ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h" ;;
++ *)
++ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h rs6000/linuxaltivec.h rs6000/linuxspe.h rs6000/e500.h" ;;
++ esac
+ extra_options="${extra_options} rs6000/sysv4.opt"
+ tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
+ case ${target} in
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch
new file mode 100644
index 000000000..aead6f67b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch
@@ -0,0 +1,80 @@
+Upstream-Status: Pending
+
+From cb9b1c041b634a4c128896e3d3eed4082608c797 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 3 May 2014 19:25:17 -0700
+Subject: [PATCH] Revert "2013-05-21 Christian Bruel
+ <christian.bruel@st.com>"
+
+This reverts commit 3983036a8b6b2710c57777194f21507819a73553.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Conflicts:
+ gcc/ChangeLog
+---
+ gcc/ChangeLog | 219 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ gcc/dwarf2out.c | 33 +++++----
+ 2 files changed, 234 insertions(+), 18 deletions(-)
+
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index 1272326..6ac2b28 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -10870,27 +10870,25 @@ static dw_loc_descr_ref
+ multiple_reg_loc_descriptor (rtx rtl, rtx regs,
+ enum var_init_status initialized)
+ {
+- int size, i;
++ int nregs, size, i;
++ unsigned reg;
+ dw_loc_descr_ref loc_result = NULL;
+
+- /* Simple, contiguous registers. */
+- if (regs == NULL_RTX)
+- {
+- unsigned reg = REGNO (rtl);
+- int nregs;
+-
++ reg = REGNO (rtl);
+ #ifdef LEAF_REG_REMAP
+- if (crtl->uses_only_leaf_regs)
+- {
+- int leaf_reg = LEAF_REG_REMAP (reg);
+- if (leaf_reg != -1)
+- reg = (unsigned) leaf_reg;
+- }
++ if (crtl->uses_only_leaf_regs)
++ {
++ int leaf_reg = LEAF_REG_REMAP (reg);
++ if (leaf_reg != -1)
++ reg = (unsigned) leaf_reg;
++ }
+ #endif
++ gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl));
++ nregs = hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)];
+
+- gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl));
+- nregs = hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)];
+-
++ /* Simple, contiguous registers. */
++ if (regs == NULL_RTX)
++ {
+ size = GET_MODE_SIZE (GET_MODE (rtl)) / nregs;
+
+ loc_result = NULL;
+@@ -10918,9 +10916,10 @@ multiple_reg_loc_descriptor (rtx rtl, rtx regs,
+ {
+ dw_loc_descr_ref t;
+
+- t = one_reg_loc_descriptor (dbx_reg_number (XVECEXP (regs, 0, i)),
++ t = one_reg_loc_descriptor (REGNO (XVECEXP (regs, 0, i)),
+ VAR_INIT_STATUS_INITIALIZED);
+ add_loc_descr (&loc_result, t);
++ size = GET_MODE_SIZE (GET_MODE (XVECEXP (regs, 0, 0)));
+ add_loc_descr_op_piece (&loc_result, size);
+ }
+
+--
+1.9.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0051-eabispe.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0051-eabispe.patch
new file mode 100644
index 000000000..55e38903f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0051-eabispe.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+Taken from http://gcc.gnu.org/ml/gcc-patches/2014-04/msg02064.html
+
+2014-04-30 Cesar Philippidis <cesar@codesourcery.com>
+
+ gcc/
+ * dwarf2cfi.c (dwf_regno): Don't assert reg is a pseudo
+ register.
+
+
+diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
+index 4180890..40ef0e2 100644
+--- a/gcc/dwarf2cfi.c
++++ b/gcc/dwarf2cfi.c
+@@ -906,7 +906,6 @@ notice_eh_throw (rtx insn)
+ static inline unsigned
+ dwf_regno (const_rtx reg)
+ {
+- gcc_assert (REGNO (reg) < FIRST_PSEUDO_REGISTER);
+ return DWARF_FRAME_REGNUM (REGNO (reg));
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch
new file mode 100644
index 000000000..f6958b32c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch
@@ -0,0 +1,138 @@
+From d626297e87e19251a284ea1e9360e831b48999ca Mon Sep 17 00:00:00 2001
+From: mpf <mpf@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 4 Sep 2014 08:32:05 +0000
+Subject: [PATCH] Add target hook to override DWARF2 frame register size
+
+gcc/
+
+ * target.def (TARGET_DWARF_FRAME_REG_MODE): New target hook.
+ * targhooks.c (default_dwarf_frame_reg_mode): New function.
+ * targhooks.h (default_dwarf_frame_reg_mode): New prototype.
+ * doc/tm.texi.in (TARGET_DWARF_FRAME_REG_MODE): Document.
+ * doc/tm.texi: Regenerate.
+ * dwarf2cfi.c (expand_builtin_init_dwarf_reg_sizes): Abstract mode
+ selection logic to default_dwarf_frame_reg_mode.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214898 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog | 10 ++++++++++
+ gcc/doc/tm.texi | 7 +++++++
+ gcc/doc/tm.texi.in | 2 ++
+ gcc/dwarf2cfi.c | 4 +---
+ gcc/target.def | 11 +++++++++++
+ gcc/targhooks.c | 13 +++++++++++++
+ gcc/targhooks.h | 1 +
+ 7 files changed, 45 insertions(+), 3 deletions(-)
+
+Index: gcc-4.9.2/gcc/doc/tm.texi
+===================================================================
+--- gcc-4.9.2.orig/gcc/doc/tm.texi
++++ gcc-4.9.2/gcc/doc/tm.texi
+@@ -9017,6 +9017,13 @@ register in Dwarf. Otherwise, this hook
+ If not defined, the default is to return @code{NULL_RTX}.
+ @end deftypefn
+
++@deftypefn {Target Hook} {enum machine_mode} TARGET_DWARF_FRAME_REG_MODE (int @var{regno})
++Given a register, this hook should return the mode which the
++corresponding Dwarf frame register should have. This is normally
++used to return a smaller mode than the raw mode to prevent call
++clobbered parts of a register altering the frame register size
++@end deftypefn
++
+ @deftypefn {Target Hook} void TARGET_INIT_DWARF_REG_SIZES_EXTRA (tree @var{address})
+ If some registers are represented in Dwarf-2 unwind information in
+ multiple pieces, define this hook to fill in information about the
+Index: gcc-4.9.2/gcc/doc/tm.texi.in
+===================================================================
+--- gcc-4.9.2.orig/gcc/doc/tm.texi.in
++++ gcc-4.9.2/gcc/doc/tm.texi.in
+@@ -6745,6 +6745,8 @@ the target supports DWARF 2 frame unwind
+
+ @hook TARGET_DWARF_REGISTER_SPAN
+
++@hook TARGET_DWARF_FRAME_REG_MODE
++
+ @hook TARGET_INIT_DWARF_REG_SIZES_EXTRA
+
+ @hook TARGET_ASM_TTYPE
+Index: gcc-4.9.2/gcc/dwarf2cfi.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/dwarf2cfi.c
++++ gcc-4.9.2/gcc/dwarf2cfi.c
+@@ -271,11 +271,9 @@ expand_builtin_init_dwarf_reg_sizes (tre
+ if (rnum < DWARF_FRAME_REGISTERS)
+ {
+ HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
+- enum machine_mode save_mode = reg_raw_mode[i];
+ HOST_WIDE_INT size;
++ enum machine_mode save_mode = targetm.dwarf_frame_reg_mode (i);
+
+- if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
+- save_mode = choose_hard_reg_mode (i, 1, true);
+ if (dnum == DWARF_FRAME_RETURN_COLUMN)
+ {
+ if (save_mode == VOIDmode)
+Index: gcc-4.9.2/gcc/target.def
+===================================================================
+--- gcc-4.9.2.orig/gcc/target.def
++++ gcc-4.9.2/gcc/target.def
+@@ -3218,6 +3218,17 @@ If not defined, the default is to return
+ rtx, (rtx reg),
+ hook_rtx_rtx_null)
+
++/* Given a register return the mode of the corresponding DWARF frame
++ register. */
++DEFHOOK
++(dwarf_frame_reg_mode,
++ "Given a register, this hook should return the mode which the\n\
++corresponding Dwarf frame register should have. This is normally\n\
++used to return a smaller mode than the raw mode to prevent call\n\
++clobbered parts of a register altering the frame register size",
++ enum machine_mode, (int regno),
++ default_dwarf_frame_reg_mode)
++
+ /* If expand_builtin_init_dwarf_reg_sizes needs to fill in table
+ entries not corresponding directly to registers below
+ FIRST_PSEUDO_REGISTER, this hook should generate the necessary
+Index: gcc-4.9.2/gcc/targhooks.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/targhooks.c
++++ gcc-4.9.2/gcc/targhooks.c
+@@ -1438,6 +1438,19 @@ default_debug_unwind_info (void)
+ return UI_NONE;
+ }
+
++/* Determine the correct mode for a Dwarf frame register that represents
++ register REGNO. */
++
++enum machine_mode
++default_dwarf_frame_reg_mode (int regno)
++{
++ enum machine_mode save_mode = reg_raw_mode[regno];
++
++ if (HARD_REGNO_CALL_PART_CLOBBERED (regno, save_mode))
++ save_mode = choose_hard_reg_mode (regno, 1, true);
++ return save_mode;
++}
++
+ /* To be used by targets where reg_raw_mode doesn't return the right
+ mode for registers used in apply_builtin_return and apply_builtin_arg. */
+
+Index: gcc-4.9.2/gcc/targhooks.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/targhooks.h
++++ gcc-4.9.2/gcc/targhooks.h
+@@ -194,6 +194,7 @@ extern int default_label_align_max_skip
+ extern int default_jump_align_max_skip (rtx);
+ extern section * default_function_section(tree decl, enum node_frequency freq,
+ bool startup, bool exit);
++extern enum machine_mode default_dwarf_frame_reg_mode (int);
+ extern enum machine_mode default_get_reg_raw_mode (int);
+
+ extern void *default_get_pch_validity (size_t *);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch
new file mode 100644
index 000000000..23b445c9e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch
@@ -0,0 +1,66 @@
+From a22a222c8f9299f6c07a0274388ade7d4ab8c28d Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Fri, 20 Jun 2014 16:41:08 -0400
+Subject: [PATCH] gcc: fix segfault from calling free on non-malloc'd area
+
+We see the following on a 32bit gcc installed on 64 bit host:
+
+ Reading symbols from ./i586-pokymllib32-linux-gcc...done.
+ (gdb) run
+ Starting program: x86-pokymllib32-linux/lib32-gcc/4.9.0-r0/image/usr/bin/i586-pokymllib32-linux-gcc
+
+ Program received signal SIGSEGV, Segmentation fault.
+ 0xf7e957e0 in free () from /lib/i386-linux-gnu/libc.so.6
+ (gdb) bt
+ #0 0xf7e957e0 in free () from /lib/i386-linux-gnu/libc.so.6
+ #1 0x0804b73c in set_multilib_dir () at gcc-4.9.0/gcc/gcc.c:7827
+ #2 main (argc=1, argv=0xffffd504) at gcc-4.9.0/gcc/gcc.c:6688
+ (gdb)
+
+The problem arises because we conditionally assign the pointer we
+eventually free, and the conditional may assign the pointer to the
+non-malloc'd internal string "." which fails when we free it here:
+
+ if (multilib_dir == NULL && multilib_os_dir != NULL
+ && strcmp (multilib_os_dir, ".") == 0)
+ {
+ free (CONST_CAST (char *, multilib_os_dir));
+ ...
+
+As suggested by Jakub, ensure the "." case is also malloc'd via
+xstrdup() and hence the pointer for the "." case can be freed.
+
+Cc: Jakub Jelinek <jakub@redhat.com>
+Cc: Jeff Law <law@redhat.com>
+Cc: Matthias Klose <doko@ubuntu.com>
+CC: Tobias Burnus <burnus@net-b.de>
+Upstream-Status: Accepted [ https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02069.html ]
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 9ac18e60d801..168acf7eb0c9 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -7790,10 +7790,15 @@ set_multilib_dir (void)
+ q2++;
+ if (*q2 == ':')
+ ml_end = q2;
+- new_multilib_os_dir = XNEWVEC (char, ml_end - q);
+- memcpy (new_multilib_os_dir, q + 1, ml_end - q - 1);
+- new_multilib_os_dir[ml_end - q - 1] = '\0';
+- multilib_os_dir = *new_multilib_os_dir ? new_multilib_os_dir : ".";
++ if (ml_end - q == 1)
++ multilib_os_dir = xstrdup (".");
++ else
++ {
++ new_multilib_os_dir = XNEWVEC (char, ml_end - q);
++ memcpy (new_multilib_os_dir, q + 1, ml_end - q - 1);
++ new_multilib_os_dir[ml_end - q - 1] = '\0';
++ multilib_os_dir = new_multilib_os_dir;
++ }
+
+ if (q2 < end && *q2 == ':')
+ {
+--
+1.9.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
new file mode 100644
index 000000000..7e8efa1e8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
@@ -0,0 +1,61 @@
+gcc/Makefile.in: fix parallel building failure
+
+The gcc-ar.o, gcc-nm.o, gcc-ranlib.o and errors.o included
+config.h which was a generated file. But no explicity rule
+to clarify the dependency. There was potential building
+failure while parallel make.
+
+For gcc-ar.o, gcc-nm.o and gcc-ranlib.o, they were compiled from one C
+source file gcc-ar.c, we add them to ALL_HOST_BACKEND_OBJS, so the
+'$(ALL_HOST_OBJS) : | $(generated_files)' rule could work for these
+objects.
+
+For errors.o, it is part of gengtype, and the gengtype generator program
+is special: Two versions are built. One is for the build machine, and one
+is for the host. We refered what gengtype-parse.o did (which also is part
+of gengtype).
+
+[GCC #61899]
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61899
+
+Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/Makefile.in | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 6475cba..56e50bb 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -1481,13 +1481,16 @@ OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \
+ opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \
+ hash-table.o file-find.o
+
++# Objects compiled from one C source file gcc-ar.c
++OBJS-gcc-ar = gcc-ar.o gcc-nm.o gcc-ranlib.o
++
+ # This lists all host objects for the front ends.
+ ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
+
+ ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
+ $(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \
+ $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \
+- lto-wrapper.o
++ lto-wrapper.o $(OBJS-gcc-ar)
+
+ # This lists all host object files, whether they are included in this
+ # compilation or not.
+@@ -2437,6 +2440,8 @@ gengtype-parse.o: $(CONFIG_H)
+ CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE
+ build/gengtype-parse.o: $(BCONFIG_H)
+
++errors.o : $(CONFIG_H)
++
+ gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
+ gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
+ $(XREGEX_H)
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch
new file mode 100644
index 000000000..557dab0f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch
@@ -0,0 +1,148 @@
+From 4fd39f1329379e00f958394adde6be96f0caf21f Mon Sep 17 00:00:00 2001
+From: hainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 5 Dec 2014 16:53:22 +0000
+Subject: [PATCH] 2014-12-05 Olivier Hainque <hainque@adacore.com>
+
+ * dwarf2cfi.c (init_one_dwarf_reg_size): New helper, processing
+ one particular reg for expand_builtin_init_dwarf_reg_sizes.
+ (expand_builtin_init_dwarf_reg_sizes): Rework to use helper and
+ account for dwarf register spans.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218428 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog | 7 +++++
+ gcc/dwarf2cfi.c | 98 +++++++++++++++++++++++++++++++++++++++++++++------------
+ 2 files changed, 85 insertions(+), 20 deletions(-)
+
+Index: gcc-4.9.2/gcc/dwarf2cfi.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/dwarf2cfi.c
++++ gcc-4.9.2/gcc/dwarf2cfi.c
+@@ -252,7 +252,59 @@ init_return_column_size (enum machine_mo
+ gen_int_mode (size, mode));
+ }
+
+-/* Generate code to initialize the register size table. */
++/* Datastructure used by expand_builtin_init_dwarf_reg_sizes and
++ init_one_dwarf_reg_size to communicate on what has been done by the
++ latter. */
++
++typedef struct
++{
++ /* Whether the dwarf return column was initialized. */
++ bool wrote_return_column;
++
++ /* For each hard register REGNO, whether init_one_dwarf_reg_size
++ was given REGNO to process already. */
++ bool processed_regno [FIRST_PSEUDO_REGISTER];
++
++} init_one_dwarf_reg_state;
++
++/* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to
++ initialize the dwarf register size table entry corresponding to register
++ REGNO in REGMODE. TABLE is the table base address, SLOTMODE is the mode to
++ use for the size entry to initialize, and INIT_STATE is the communication
++ datastructure conveying what we're doing to our caller. */
++
++static
++void init_one_dwarf_reg_size (int regno, machine_mode regmode,
++ rtx table, machine_mode slotmode,
++ init_one_dwarf_reg_state *init_state)
++{
++ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
++ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
++
++ const HOST_WIDE_INT slotoffset = rnum * GET_MODE_SIZE (slotmode);
++ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
++
++ init_state->processed_regno[regno] = true;
++
++ if (rnum >= DWARF_FRAME_REGISTERS)
++ return;
++
++ if (dnum == DWARF_FRAME_RETURN_COLUMN)
++ {
++ if (regmode == VOIDmode)
++ return;
++ init_state->wrote_return_column = true;
++ }
++
++ if (slotoffset < 0)
++ return;
++
++ emit_move_insn (adjust_address (table, slotmode, slotoffset),
++ gen_int_mode (regsize, slotmode));
++}
++
++/* Generate code to initialize the dwarf register size table located
++ at the provided ADDRESS. */
+
+ void
+ expand_builtin_init_dwarf_reg_sizes (tree address)
+@@ -261,35 +313,40 @@ expand_builtin_init_dwarf_reg_sizes (tre
+ enum machine_mode mode = TYPE_MODE (char_type_node);
+ rtx addr = expand_normal (address);
+ rtx mem = gen_rtx_MEM (BLKmode, addr);
+- bool wrote_return_column = false;
++
++ init_one_dwarf_reg_state init_state;
++
++ memset ((char *)&init_state, 0, sizeof (init_state));
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+- unsigned int dnum = DWARF_FRAME_REGNUM (i);
+- unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
+-
+- if (rnum < DWARF_FRAME_REGISTERS)
+- {
+- HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
+- HOST_WIDE_INT size;
+- enum machine_mode save_mode = targetm.dwarf_frame_reg_mode (i);
++ machine_mode save_mode;
++ rtx span;
+
+- if (dnum == DWARF_FRAME_RETURN_COLUMN)
++ /* No point in processing a register multiple times. This could happen
++ with register spans, e.g. when a reg is first processed as a piece of
++ a span, then as a register on its own later on. */
++
++ if (init_state.processed_regno[i])
++ continue;
++
++ save_mode = targetm.dwarf_frame_reg_mode (i);
++ span = targetm.dwarf_register_span (gen_rtx_REG (save_mode, i));
++ if (!span)
++ init_one_dwarf_reg_size (i, save_mode, mem, mode, &init_state);
++ else
++ {
++ for (int si = 0; si < XVECLEN (span, 0); si++)
+ {
+- if (save_mode == VOIDmode)
+- continue;
+- wrote_return_column = true;
+- }
+- size = GET_MODE_SIZE (save_mode);
+- if (offset < 0)
+- continue;
++ rtx reg = XVECEXP (span, 0, si);
++ init_one_dwarf_reg_size
++ (REGNO (reg), GET_MODE (reg), mem, mode, &init_state);
++ }
+
+- emit_move_insn (adjust_address (mem, mode, offset),
+- gen_int_mode (size, mode));
+ }
+ }
+
+- if (!wrote_return_column)
++ if (!init_state.wrote_return_column)
+ init_return_column_size (mode, mem, DWARF_FRAME_RETURN_COLUMN);
+
+ #ifdef DWARF_ALT_FRAME_RETURN_COLUMN
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch
new file mode 100644
index 000000000..3b6c94c49
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch
@@ -0,0 +1,75 @@
+From c0235a33de8c4f78cce35b2a8c2035c83fe1bd14 Mon Sep 17 00:00:00 2001
+From: hainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 5 Dec 2014 17:01:42 +0000
+Subject: [PATCH] 2014-12-05 Olivier Hainque <hainque@adacore.com>
+
+ gcc/
+ * defaults.h: (DWARF_REG_TO_UNWIND_COLUMN): Define default.
+ * dwarf2cfi.c (init_one_dwarf_reg_size): Honor
+ DWARF_REG_TO_UNWIND_COLUMN.
+
+ libgcc/
+ * unwind-dw2.c (DWARF_REG_TO_UNWIND_COLUMN): Remove default def,
+ now provided by defaults.h.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218429 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog | 6 ++++++
+ gcc/defaults.h | 5 +++++
+ gcc/dwarf2cfi.c | 3 ++-
+ libgcc/ChangeLog | 5 +++++
+ libgcc/unwind-dw2.c | 4 ----
+ 5 files changed, 18 insertions(+), 5 deletions(-)
+
+Index: gcc-4.9.2/gcc/defaults.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/defaults.h
++++ gcc-4.9.2/gcc/defaults.h
+@@ -438,6 +438,11 @@ see the files COPYING3 and COPYING.RUNTI
+ #define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG)
+ #endif
+
++/* The mapping from dwarf CFA reg number to internal dwarf reg numbers. */
++#ifndef DWARF_REG_TO_UNWIND_COLUMN
++#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
++#endif
++
+ /* Map register numbers held in the call frame info that gcc has
+ collected using DWARF_FRAME_REGNUM to those that should be output in
+ .debug_frame and .eh_frame. */
+Index: gcc-4.9.2/gcc/dwarf2cfi.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/dwarf2cfi.c
++++ gcc-4.9.2/gcc/dwarf2cfi.c
+@@ -280,8 +280,9 @@ void init_one_dwarf_reg_size (int regno,
+ {
+ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
+ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
++ const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
+
+- const HOST_WIDE_INT slotoffset = rnum * GET_MODE_SIZE (slotmode);
++ const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
+ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
+
+ init_state->processed_regno[regno] = true;
+Index: gcc-4.9.2/libgcc/unwind-dw2.c
+===================================================================
+--- gcc-4.9.2.orig/libgcc/unwind-dw2.c
++++ gcc-4.9.2/libgcc/unwind-dw2.c
+@@ -55,10 +55,6 @@
+ #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
+ #endif
+
+-#ifndef DWARF_REG_TO_UNWIND_COLUMN
+-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
+-#endif
+-
+ /* ??? For the public function interfaces, we tend to gcc_assert that the
+ column numbers are in range. For the dwarf2 unwind info this does happen,
+ although so far in a case that doesn't actually matter.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch
new file mode 100644
index 000000000..f29559698
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch
@@ -0,0 +1,32 @@
+Disable the MULTILIB_OSDIRNAMES and other multilib options.
+
+Hard coding the MULTILIB_OSDIRNAMES with ../lib64 is causing problems on
+systems where the libdir is NOT set to /lib64. This is allowed by the ABI, as
+long as the dynamic loader is present in /lib.
+
+We simply want to use the default rules in gcc to find and configure the
+normal libdir.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: gcc-4.9.1/gcc/config/aarch64/t-aarch64-linux
+===================================================================
+--- gcc-4.9.1.orig/gcc/config/aarch64/t-aarch64-linux
++++ gcc-4.9.1/gcc/config/aarch64/t-aarch64-linux
+@@ -21,11 +21,11 @@
+ LIB1ASMSRC = aarch64/lib1funcs.asm
+ LIB1ASMFUNCS = _aarch64_sync_cache_range
+
+-AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
+-MULTILIB_OSDIRNAMES = .=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
+-MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
++#AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
++#MULTILIB_OSDIRNAMES = .=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
++#MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
+
+ # Disable the multilib for linux-gnu targets for the time being; focus
+ # on the baremetal targets.
+-MULTILIB_OPTIONS =
+-MULTILIB_DIRNAMES =
++#MULTILIB_OPTIONS =
++#MULTILIB_DIRNAMES =
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch
new file mode 100644
index 000000000..d442ba8a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch
@@ -0,0 +1,113 @@
+From ca03cf1b133d66eb978c68f6dbc345e9aabcba88 Mon Sep 17 00:00:00 2001
+From: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Mon, 30 Jun 2014 19:30:52 +0000
+Subject: [PATCH] r212171
+
+* except.c (emit_note_eh_region_end): New helper
+ function. (convert_to_eh_region_ranges): Use
+ emit_note_eh_region_end to emit EH_REGION_END note.
+ * jump.c (cleanup_barriers): Do not split a call and its
+ corresponding CALL_ARG_LOCATION note.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212171 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=212171]
+Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
+---
+ gcc/except.c | 23 ++++++++++++++++++-----
+ gcc/jump.c | 19 +++++++++++++++----
+ 2 files changed, 33 insertions(+), 9 deletions(-)
+
+diff --git a/gcc/except.c b/gcc/except.c
+index dc5c1d2..7ac114f 100644
+--- a/gcc/except.c
++++ b/gcc/except.c
+@@ -2466,6 +2466,20 @@ add_call_site (rtx landing_pad, int action, int section)
+ return call_site_base + crtl->eh.call_site_record_v[section]->length () - 1;
+ }
+
++static rtx
++emit_note_eh_region_end (rtx insn)
++{
++ rtx next = NEXT_INSN (insn);
++
++ /* Make sure we do not split a call and its corresponding
++ CALL_ARG_LOCATION note. */
++ if (next && NOTE_P (next)
++ && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
++ insn = next;
++
++ return emit_note_after (NOTE_INSN_EH_REGION_END, insn);
++}
++
+ /* Turn REG_EH_REGION notes back into NOTE_INSN_EH_REGION notes.
+ The new note numbers will not refer to region numbers, but
+ instead to call site entries. */
+@@ -2544,8 +2558,8 @@ convert_to_eh_region_ranges (void)
+ note = emit_note_before (NOTE_INSN_EH_REGION_BEG,
+ first_no_action_insn_before_switch);
+ NOTE_EH_HANDLER (note) = call_site;
+- note = emit_note_after (NOTE_INSN_EH_REGION_END,
+- last_no_action_insn_before_switch);
++ note
++ = emit_note_eh_region_end (last_no_action_insn_before_switch);
+ NOTE_EH_HANDLER (note) = call_site;
+ gcc_assert (last_action != -3
+ || (last_action_insn
+@@ -2569,8 +2583,7 @@ convert_to_eh_region_ranges (void)
+ first_no_action_insn = NULL_RTX;
+ }
+
+- note = emit_note_after (NOTE_INSN_EH_REGION_END,
+- last_action_insn);
++ note = emit_note_eh_region_end (last_action_insn);
+ NOTE_EH_HANDLER (note) = call_site;
+ }
+
+@@ -2617,7 +2630,7 @@ convert_to_eh_region_ranges (void)
+
+ if (last_action >= -1 && ! first_no_action_insn)
+ {
+- note = emit_note_after (NOTE_INSN_EH_REGION_END, last_action_insn);
++ note = emit_note_eh_region_end (last_action_insn);
+ NOTE_EH_HANDLER (note) = call_site;
+ }
+
+diff --git a/gcc/jump.c b/gcc/jump.c
+index 9418f65..a5e5f52 100644
+--- a/gcc/jump.c
++++ b/gcc/jump.c
+@@ -121,15 +121,26 @@ rebuild_jump_labels_chain (rtx chain)
+ static unsigned int
+ cleanup_barriers (void)
+ {
+- rtx insn, next, prev;
+- for (insn = get_insns (); insn; insn = next)
++ rtx insn;
++ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ {
+- next = NEXT_INSN (insn);
+ if (BARRIER_P (insn))
+ {
+- prev = prev_nonnote_insn (insn);
++ rtx prev = prev_nonnote_insn (insn);
+ if (!prev)
+ continue;
++
++ if (CALL_P (prev))
++ {
++ /* Make sure we do not split a call and its corresponding
++ CALL_ARG_LOCATION note. */
++ rtx next = NEXT_INSN (prev);
++
++ if (NOTE_P (next)
++ && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
++ prev = next;
++ }
++
+ if (BARRIER_P (prev))
+ delete_insn (insn);
+ else if (prev != PREV_INSN (insn))
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch
new file mode 100644
index 000000000..de827cbda
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch
@@ -0,0 +1,59 @@
+From 6eae3e637fcc22d21b51d44d61e3a9cb4825e776 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 30 Oct 2014 20:37:14 -0700
+Subject: [PATCH]PR rtl-optimization/63348
+
+PR rtl-optimization/63348
+* emit-rtl.c (try_split): Do not emit extra barrier.
+
+Note: this patch is to fix the side effect introduced by r212171 which was reported at:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63348
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215613 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=215613]
+Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ gcc/emit-rtl.c | 11 -----------
+ 1 files changed, 0 insertions(+), 11 deletions(-)
+
+diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
+index 4736f8d..ae69dbd 100644
+--- a/gcc/emit-rtl.c
++++ b/gcc/emit-rtl.c
+@@ -3422,7 +3422,6 @@ try_split (rtx pat, rtx trial, int last)
+ {
+ rtx before = PREV_INSN (trial);
+ rtx after = NEXT_INSN (trial);
+- int has_barrier = 0;
+ rtx note, seq, tem;
+ int probability;
+ rtx insn_last, insn;
+@@ -3441,14 +3440,6 @@ try_split (rtx pat, rtx trial, int last)
+
+ split_branch_probability = -1;
+
+- /* If we are splitting a JUMP_INSN, it might be followed by a BARRIER.
+- We may need to handle this specially. */
+- if (after && BARRIER_P (after))
+- {
+- has_barrier = 1;
+- after = NEXT_INSN (after);
+- }
+-
+ if (!seq)
+ return trial;
+
+@@ -3594,8 +3585,6 @@ try_split (rtx pat, rtx trial, int last)
+ tem = emit_insn_after_setloc (seq, trial, INSN_LOCATION (trial));
+
+ delete_insn (trial);
+- if (has_barrier)
+- emit_barrier_after (tem);
+
+ /* Recursively call try_split for each new insn created; by the
+ time control returns here that insn will be fully split, so
+--
+1.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
new file mode 100644
index 000000000..75a9fdd44
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
@@ -0,0 +1,55 @@
+From 5c0092070253113cf0d9c45eacc884b3ecc34d81 Mon Sep 17 00:00:00 2001
+From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sat, 25 Oct 2014 00:23:17 +0000
+Subject: [PATCH] Only allow e500 double in SPE_SIMD_REGNO_P registers.
+
+rs6000_hard_regno_nregs_internal allows SPE vectors in single
+registers satisfying SPE_SIMD_REGNO_P (i.e. register numbers 0 to
+31). However, the corresponding test for e500 double treats all
+registers as being able to store a 64-bit value, rather than just
+those GPRs.
+
+Logically this inconsistency is wrong; in addition, it causes problems
+unwinding from signal handlers. linux-unwind.h uses
+ARG_POINTER_REGNUM as a place to store the return address from a
+signal handler, but this logic in rs6000_hard_regno_nregs_internal
+results in that being considered an 8-byte register, resulting in
+assertion failures.
+(<https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02625.html> first
+needs to be applied for unwinding to work in general on e500.) This
+patch makes rs6000_hard_regno_nregs_internal handle the e500 double
+case consistently with SPE vectors.
+
+Tested with no regressions with cross to powerpc-linux-gnuspe (given
+the aforementioned patch applied). Failures of signal handling
+unwinding tests such as gcc.dg/cleanup-{8,9,10,11}.c are fixed by this
+patch.
+
+ * config/rs6000/rs6000.c (rs6000_hard_regno_nregs_internal): Do
+ not allow e500 double in registers not satisyfing
+ SPE_SIMD_REGNO_P.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216688 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog | 6 ++++++
+ gcc/config/rs6000/rs6000.c | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+Index: gcc-4.9.2/gcc/config/rs6000/rs6000.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/rs6000/rs6000.c
++++ gcc-4.9.2/gcc/config/rs6000/rs6000.c
+@@ -1703,7 +1703,7 @@ rs6000_hard_regno_nregs_internal (int re
+ SCmode so as to pass the value correctly in a pair of
+ registers. */
+ else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
+- && !DECIMAL_FLOAT_MODE_P (mode))
++ && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P (regno))
+ reg_size = UNITS_PER_FP_WORD;
+
+ else
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch
new file mode 100644
index 000000000..f48c66dca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch
@@ -0,0 +1,81 @@
+Ensure target gcc headers can be included
+
+There are a few headers installed as part of the OpenEmbedded
+gcc-runtime target (omp.h, ssp/*.h). Being installed from a recipe
+built for the target architecture, these are within the target
+sysroot and not cross/nativesdk; thus they weren't able to be
+found by gcc with the existing search paths. Add support for
+picking up these headers under the sysroot supplied on the gcc
+command line in order to resolve this.
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Upstream-Status: Pending
+
+--- a/gcc/Makefile.in 2014-12-23 11:57:33.327873331 +0000
++++ b/gcc/Makefile.in 2015-01-21 11:32:35.447305394 +0000
+@@ -587,6 +587,7 @@
+
+ # Directory in which the compiler finds libraries etc.
+ libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
++libsubdir_target = gcc/$(target_noncanonical)/$(version)
+ # Directory in which the compiler finds executables
+ libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version)
+ # Directory in which all plugin resources are installed
+@@ -2534,6 +2535,7 @@
+
+ PREPROCESSOR_DEFINES = \
+ -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
++ -DGCC_INCLUDE_SUBDIR_TARGET=\"$(libsubdir_target)/include\" \
+ -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
+ -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
+ -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
+--- a/gcc/cppdefault.c 2015-01-13 17:40:26.131012725 +0000
++++ b/gcc/cppdefault.c 2015-01-21 11:30:08.928426492 +0000
+@@ -59,6 +59,10 @@
+ /* This is the dir for gcc's private headers. */
+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
+ #endif
++#ifdef GCC_INCLUDE_SUBDIR_TARGET
++ /* This is the dir for gcc's private headers under the specified sysroot. */
++ { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
++#endif
+ #ifdef LOCAL_INCLUDE_DIR
+ /* /usr/local/include comes before the fixincluded header files. */
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+diff --git a/gcc/defaults.h b/gcc/defaults.h
+index f94ae17..d98b40b 100644
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -1390,4 +1390,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+
+ #endif /* GCC_INSN_FLAGS_H */
+
++/* Default prefixes to attach to command names. */
++
++#ifndef STANDARD_STARTFILE_PREFIX_1
++#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
++#endif
++#ifndef STANDARD_STARTFILE_PREFIX_2
++#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
++#endif
++
+ #endif /* ! GCC_DEFAULTS_H */
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 9f0b781..174fca8 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1189,13 +1189,6 @@ static const char *gcc_libexec_prefix;
+
+ /* Default prefixes to attach to command names. */
+
+-#ifndef STANDARD_STARTFILE_PREFIX_1
+-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+-#endif
+-#ifndef STANDARD_STARTFILE_PREFIX_2
+-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
+-#endif
+-
+ #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */
+ #undef MD_EXEC_PREFIX
+ #undef MD_STARTFILE_PREFIX
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
new file mode 100644
index 000000000..c48bd4847
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
@@ -0,0 +1,24 @@
+From 861bcfd4ae814f351e0c668ee26d01d1331e0422 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Apr 2015 23:15:27 -0700
+Subject: [PATCH 36/37] Use SYSTEMLIBS_DIR replacement instead of hardcoding
+ base_libdir
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/aarch64/aarch64-linux.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: gcc-4.9.2/gcc/config/aarch64/aarch64-linux.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/aarch64/aarch64-linux.h
++++ gcc-4.9.2/gcc/config/aarch64/aarch64-linux.h
+@@ -21,7 +21,7 @@
+ #ifndef GCC_AARCH64_LINUX_H
+ #define GCC_AARCH64_LINUX_H
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}.so.1"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}.so.1"
+
+ #define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0063-nativesdk-gcc-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0063-nativesdk-gcc-support.patch
new file mode 100644
index 000000000..f9efa4537
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0063-nativesdk-gcc-support.patch
@@ -0,0 +1,198 @@
+Being able to build a nativesdk gcc is useful, particularly in cases
+where the host compiler may be of an incompatible version (or a 32
+bit compiler is needed).
+
+Sadly, building nativesdk-gcc is not straight forward. We install
+nativesdk-gcc into a relocatable location and this means that its
+library locations can change. "Normal" sysroot support doesn't help
+in this case since the values of paths like "libdir" change, not just
+base root directory of the system.
+
+In order to handle this we do two things:
+
+a) Add %r into spec file markup which can be used for injected paths
+ such as SYSTEMLIBS_DIR (see gcc_multilib_setup()).
+b) Add other paths which need relocation into a .gccrelocprefix section
+ which the relocation code will notice and adjust automatically.
+
+Upstream-Status: Inappropriate
+RP 2015/7/28
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 5fd3d0a..2de29aa 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -120,6 +120,8 @@ static const char *target_system_root = TARGET_SYSTEM_ROOT;
+ #else
+ static const char *target_system_root = 0;
+ #endif
++
++static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
+
+ /* Nonzero means pass the updated target_system_root to the compiler. */
+
+@@ -384,6 +386,7 @@ or with constant text in a single argument.
+ %G process LIBGCC_SPEC as a spec.
+ %R Output the concatenation of target_system_root and
+ target_sysroot_suffix.
++ %r Output the base path target_relocatable_prefix
+ %S process STARTFILE_SPEC as a spec. A capital S is actually used here.
+ %E process ENDFILE_SPEC as a spec. A capital E is actually used here.
+ %C process CPP_SPEC as a spec.
+@@ -1218,10 +1221,10 @@ static const char *gcc_libexec_prefix;
+ gcc_exec_prefix is set because, in that case, we know where the
+ compiler has been installed, and use paths relative to that
+ location instead. */
+-static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
+-static const char *const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX;
+-static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
+-static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
++static char standard_exec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_EXEC_PREFIX;
++static char standard_libexec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_LIBEXEC_PREFIX;
++static char standard_bindir_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_BINDIR_PREFIX;
++static char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
+
+ /* For native compilers, these are well-known paths containing
+ components that may be provided by the system. For cross
+@@ -1229,9 +1232,9 @@ static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
+ static const char *md_exec_prefix = MD_EXEC_PREFIX;
+ static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
+ static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
+-static const char *const standard_startfile_prefix_1
++static char standard_startfile_prefix_1[4096] __attribute__ ((section (".gccrelocprefix")))
+ = STANDARD_STARTFILE_PREFIX_1;
+-static const char *const standard_startfile_prefix_2
++static char standard_startfile_prefix_2[4096] __attribute__ ((section (".gccrelocprefix")))
+ = STANDARD_STARTFILE_PREFIX_2;
+
+ /* A relative path to be used in finding the location of tools
+@@ -5305,6 +5308,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
+ }
+ break;
+
++ case 'r':
++ obstack_grow (&obstack, target_relocatable_prefix,
++ strlen (target_relocatable_prefix));
++ break;
++
+ case 'S':
+ value = do_spec_1 (startfile_spec, 0, NULL);
+ if (value != 0)
+
+diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
+index dad69e6..cf43f28 100644
+--- a/gcc/cppdefault.c
++++ b/gcc/cppdefault.c
+@@ -35,6 +35,30 @@
+ # undef CROSS_INCLUDE_DIR
+ #endif
+
++static char GPLUSPLUS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_INCLUDE_DIR;
++static char GCC_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GCC_INCLUDE_DIR;
++static char GPLUSPLUS_TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_TOOL_INCLUDE_DIR;
++static char GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_BACKWARD_INCLUDE_DIR;
++static char STANDARD_STARTFILE_PREFIX_2VAR[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET;
++#ifdef LOCAL_INCLUDE_DIR
++static char LOCAL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = LOCAL_INCLUDE_DIR;
++#endif
++#ifdef PREFIX_INCLUDE_DIR
++static char PREFIX_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = PREFIX_INCLUDE_DIR;
++#endif
++#ifdef FIXED_INCLUDE_DIR
++static char FIXED_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = FIXED_INCLUDE_DIR;
++#endif
++#ifdef CROSS_INCLUDE_DIR
++static char CROSS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = CROSS_INCLUDE_DIR;
++#endif
++#ifdef TOOL_INCLUDE_DIR
++static char TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = TOOL_INCLUDE_DIR;
++#endif
++#ifdef NATIVE_SYSTEM_HEADER_DIR
++static char NATIVE_SYSTEM_HEADER_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = NATIVE_SYSTEM_HEADER_DIR;
++#endif
++
+ const struct default_include cpp_include_defaults[]
+ #ifdef INCLUDE_DEFAULTS
+ = INCLUDE_DEFAULTS;
+@@ -42,38 +66,38 @@ const struct default_include cpp_include_defaults[]
+ = {
+ #ifdef GPLUSPLUS_INCLUDE_DIR
+ /* Pick up GNU C++ generic include files. */
+- { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1,
++ { GPLUSPLUS_INCLUDE_DIRVAR, "G++", 1, 1,
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
+ #endif
+ #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
+ /* Pick up GNU C++ target-dependent include files. */
+- { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1,
++ { GPLUSPLUS_TOOL_INCLUDE_DIRVAR, "G++", 1, 1,
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 },
+ #endif
+ #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
+ /* Pick up GNU C++ backward and deprecated include files. */
+- { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1,
++ { GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR, "G++", 1, 1,
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
+ #endif
+ #ifdef GCC_INCLUDE_DIR
+ /* This is the dir for gcc's private headers. */
+- { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
++ { GCC_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 },
+ #endif
+ #ifdef GCC_INCLUDE_SUBDIR_TARGET
+ /* This is the dir for gcc's private headers under the specified sysroot. */
+- { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
++ { STANDARD_STARTFILE_PREFIX_2VAR, "GCC", 0, 0, 1, 0 },
+ #endif
+ #ifdef LOCAL_INCLUDE_DIR
+ /* /usr/local/include comes before the fixincluded header files. */
+- { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+- { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
++ { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 2 },
++ { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 0 },
+ #endif
+ #ifdef PREFIX_INCLUDE_DIR
+- { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0 },
++ { PREFIX_INCLUDE_DIRVAR, 0, 0, 1, 0, 0 },
+ #endif
+ #ifdef FIXED_INCLUDE_DIR
+ /* This is the dir for fixincludes. */
+- { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0,
++ { FIXED_INCLUDE_DIRVAR, "GCC", 0, 0, 0,
+ /* A multilib suffix needs adding if different multilibs use
+ different headers. */
+ #ifdef SYSROOT_HEADERS_SUFFIX_SPEC
+@@ -85,16 +109,16 @@ const struct default_include cpp_include_defaults[]
+ #endif
+ #ifdef CROSS_INCLUDE_DIR
+ /* One place the target system's headers might be. */
+- { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
++ { CROSS_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 },
+ #endif
+ #ifdef TOOL_INCLUDE_DIR
+ /* Another place the target system's headers might be. */
+- { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 },
++ { TOOL_INCLUDE_DIRVAR, "BINUTILS", 0, 1, 0, 0 },
+ #endif
+ #ifdef NATIVE_SYSTEM_HEADER_DIR
+ /* /usr/include comes dead last. */
+- { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
+- { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
++ { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
++ { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
+ #endif
+ { 0, 0, 0, 0, 0, 0 }
+ };
+diff --git a/gcc/cppdefault.h b/gcc/cppdefault.h
+index 30b6fed..2ef96b7 100644
+--- a/gcc/cppdefault.h
++++ b/gcc/cppdefault.h
+@@ -33,7 +33,8 @@
+
+ struct default_include
+ {
+- const char *const fname; /* The name of the directory. */
++ const char *fname; /* The name of the directory. */
++
+ const char *const component; /* The component containing the directory
+ (see update_path in prefix.c) */
+ const char cplusplus; /* Only look here if we're compiling C++. */
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0064-handle-target-sysroot-multilib.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0064-handle-target-sysroot-multilib.patch
new file mode 100644
index 000000000..53569847f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0064-handle-target-sysroot-multilib.patch
@@ -0,0 +1,88 @@
+Search target sysroot gcc version specific dirs with multilib.
+
+We install the gcc libraries (such as crtbegin.p) into
+<sysroot><libdir>/<target-sys>/5.2.0/
+which is a default search path for GCC (aka multi_suffix in the
+code below). <target-sys> is 'machine' in gcc's terminology. We use
+these directories so that multiple gcc versions could in theory
+co-exist on target.
+
+We only want to build one gcc-cross-canadian per arch and have this work
+for all multilibs. <target-sys> can be handled by mapping the multilib
+<target-sys> to the one used by gcc-cross-canadian, e.g. mips64-polkmllib32-linux
+is symlinked to by mips64-poky-linux.
+
+The default gcc search path in the target sysroot for a "lib64" mutlilib is:
+
+<sysroot>/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/../lib64/
+<sysroot>/usr/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/../lib64/
+<sysroot>/lib32/
+<sysroot>/usr/lib32/
+
+which means that the lib32 crtbegin.o will be found and the lib64 ones
+will not which leads to compiler failures.
+
+This patch injects a multilib version of that path first so the lib64
+binaries can be found first. With this change the search path becomes:
+
+<sysroot>/lib32/../lib64/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/../lib64/
+<sysroot>/usr/lib32/../lib64/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/../lib64/
+<sysroot>/lib32/
+<sysroot>/usr/lib32/
+
+Upstream-Status: Pending
+RP 2015/7/31
+
+Index: gcc-5.2.0/gcc/gcc.c
+===================================================================
+--- gcc-5.2.0.orig/gcc/gcc.c
++++ gcc-5.2.0/gcc/gcc.c
+@@ -2305,7 +2305,7 @@ for_each_path (const struct path_prefix
+ if (path == NULL)
+ {
+ len = paths->max_len + extra_space + 1;
+- len += MAX (MAX (suffix_len, multi_os_dir_len), multiarch_len);
++ len += MAX ((suffix_len + multi_os_dir_len), multiarch_len);
+ path = XNEWVEC (char, len);
+ }
+
+@@ -2317,6 +2317,33 @@ for_each_path (const struct path_prefix
+ /* Look first in MACHINE/VERSION subdirectory. */
+ if (!skip_multi_dir)
+ {
++ if (!(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir))
++ {
++ const char *this_multi;
++ size_t this_multi_len;
++
++ if (pl->os_multilib)
++ {
++ this_multi = multi_os_dir;
++ this_multi_len = multi_os_dir_len;
++ }
++ else
++ {
++ this_multi = multi_dir;
++ this_multi_len = multi_dir_len;
++ }
++
++ /* Look in multilib MACHINE/VERSION subdirectory first */
++ if (this_multi_len)
++ {
++ memcpy (path + len, this_multi, this_multi_len + 1);
++ memcpy (path + len + this_multi_len, multi_suffix, suffix_len + 1);
++ ret = callback (path, callback_info);
++ if (ret)
++ break;
++ }
++ }
++
+ memcpy (path + len, multi_suffix, suffix_len + 1);
+ ret = callback (path, callback_info);
+ if (ret)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0065-gcc-483-universal-initializer-no-warning.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0065-gcc-483-universal-initializer-no-warning.patch
new file mode 100644
index 000000000..fde227b8a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0065-gcc-483-universal-initializer-no-warning.patch
@@ -0,0 +1,107 @@
+Upstream-Status: Backport
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+Fix for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
+wrong warning when using the universal zero initializer {0}
+
+Backported to GCC 4.8.3
+
+Subject: 2014-06-05 S. Gilles <sgilles@terpmail.umd.edu>
+X-Git-Url: http://repo.or.cz/w/official-gcc.git/commitdiff_plain/95cdf3fdf2d440eb7775def8e35ab970651c33d9?hp=14a3093e9943937cbc63dfbf4d51ca60f8325b29
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211289 138bc75d-0d04-0410-961f-82ee72b054a4
+
+--- gcc-4.8.3.org/gcc/c/c-typeck.c 2014-08-03 20:52:09.257042137 +0200
++++ gcc-4.8.3/gcc/c/c-typeck.c 2014-08-03 20:57:10.645042614 +0200
+@@ -62,9 +62,9 @@
+ if expr.original_code == SIZEOF_EXPR. */
+ tree c_last_sizeof_arg;
+
+-/* Nonzero if we've already printed a "missing braces around initializer"
+- message within this initializer. */
+-static int missing_braces_mentioned;
++/* Nonzero if we might need to print a "missing braces around
++ initializer" message within this initializer. */
++static int found_missing_braces;
+
+ static int require_constant_value;
+ static int require_constant_elements;
+@@ -6379,6 +6379,9 @@
+ /* 1 if this constructor is erroneous so far. */
+ static int constructor_erroneous;
+
++/* 1 if this constructor is the universal zero initializer { 0 }. */
++static int constructor_zeroinit;
++
+ /* Structure for managing pending initializer elements, organized as an
+ AVL tree. */
+
+@@ -6540,7 +6543,7 @@
+ constructor_stack = 0;
+ constructor_range_stack = 0;
+
+- missing_braces_mentioned = 0;
++ found_missing_braces = 0;
+
+ spelling_base = 0;
+ spelling_size = 0;
+@@ -6635,6 +6638,7 @@
+ constructor_type = type;
+ constructor_incremental = 1;
+ constructor_designated = 0;
++ constructor_zeroinit = 1;
+ designator_depth = 0;
+ designator_erroneous = 0;
+
+@@ -6832,11 +6836,8 @@
+ set_nonincremental_init (braced_init_obstack);
+ }
+
+- if (implicit == 1 && warn_missing_braces && !missing_braces_mentioned)
+- {
+- missing_braces_mentioned = 1;
+- warning_init (OPT_Wmissing_braces, "missing braces around initializer");
+- }
++ if (implicit == 1)
++ found_missing_braces = 1;
+
+ if (TREE_CODE (constructor_type) == RECORD_TYPE
+ || TREE_CODE (constructor_type) == UNION_TYPE)
+@@ -6969,16 +6970,23 @@
+ }
+ }
+
++ if (vec_safe_length (constructor_elements) != 1)
++ constructor_zeroinit = 0;
++
++ /* Warn when some structs are initialized with direct aggregation. */
++ if (!implicit && found_missing_braces && warn_missing_braces
++ && !constructor_zeroinit)
++ {
++ warning_init (OPT_Wmissing_braces,
++ "missing braces around initializer");
++ }
++
+ /* Warn when some struct elements are implicitly initialized to zero. */
+ if (warn_missing_field_initializers
+ && constructor_type
+ && TREE_CODE (constructor_type) == RECORD_TYPE
+ && constructor_unfilled_fields)
+ {
+- bool constructor_zeroinit =
+- (vec_safe_length (constructor_elements) == 1
+- && integer_zerop ((*constructor_elements)[0].value));
+-
+ /* Do not warn for flexible array members or zero-length arrays. */
+ while (constructor_unfilled_fields
+ && (!DECL_SIZE (constructor_unfilled_fields)
+@@ -8093,6 +8101,9 @@
+ designator_depth = 0;
+ designator_erroneous = 0;
+
++ if (!implicit && value.value && !integer_zerop (value.value))
++ constructor_zeroinit = 0;
++
+ /* Handle superfluous braces around string cst as in
+ char x[] = {"foo"}; */
+ if (string_flag
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0066-cxxflags-for-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0066-cxxflags-for-build.patch
new file mode 100644
index 000000000..1105e29f6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0066-cxxflags-for-build.patch
@@ -0,0 +1,123 @@
+Fix various _FOR_BUILD and related variables
+
+When doing a FOR_BUILD thing, you have to override CFLAGS with
+CFLAGS_FOR_BUILD. And if you use C++, you also have to override
+CXXFLAGS with CXXFLAGS_FOR_BUILD.
+Without this, when building for mingw, you end up trying to use
+the mingw headers for a host build.
+
+The same goes for other variables as well, such as CPPFLAGS,
+CPP, and GMPINC.
+
+Upstream-Status: Pending
+
+Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/Makefile.in b/Makefile.in
+index 9370174..011c29a 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -152,6 +152,7 @@ BUILD_EXPORTS = \
+ CPP="$(CC_FOR_BUILD) -E"; export CPP; \
+ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
++ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_BUILD)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+@@ -170,6 +171,9 @@ BUILD_EXPORTS = \
+ # built for the build system to override those in BASE_FLAGS_TO_PASS.
+ EXTRA_BUILD_FLAGS = \
+ CFLAGS="$(CFLAGS_FOR_BUILD)" \
++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
++ CPP="$(CC_FOR_BUILD) -E" \
++ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \
+ LDFLAGS="$(LDFLAGS_FOR_BUILD)"
+
+ # This is the list of directories to built for the host system.
+@@ -187,6 +191,7 @@ HOST_SUBDIR = @host_subdir@
+ HOST_EXPORTS = \
+ $(BASE_EXPORTS) \
+ CC="$(CC)"; export CC; \
++ CPP="$(CC) -E"; export CPP; \
+ ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
+ CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+@@ -711,6 +715,7 @@ BASE_FLAGS_TO_PASS = \
+ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+ "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
+ "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
++ "CXXFLAGS_FOR_BUILD=$(CXXFLAGS_FOR_BUILD)" \
+ "EXPECT=$(EXPECT)" \
+ "FLEX=$(FLEX)" \
+ "INSTALL=$(INSTALL)" \
+diff --git a/Makefile.tpl b/Makefile.tpl
+index 1ea1954..78a59c3 100644
+--- a/Makefile.tpl
++++ b/Makefile.tpl
+@@ -154,6 +154,7 @@ BUILD_EXPORTS = \
+ CC="$(CC_FOR_BUILD)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
++ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_BUILD)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+@@ -172,6 +173,9 @@ BUILD_EXPORTS = \
+ # built for the build system to override those in BASE_FLAGS_TO_PASS.
+ EXTRA_BUILD_FLAGS = \
+ CFLAGS="$(CFLAGS_FOR_BUILD)" \
++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
++ CPP="$(CC_FOR_BUILD) -E" \
++ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \
+ LDFLAGS="$(LDFLAGS_FOR_BUILD)"
+
+ # This is the list of directories to built for the host system.
+@@ -189,6 +193,7 @@ HOST_SUBDIR = @host_subdir@
+ HOST_EXPORTS = \
+ $(BASE_EXPORTS) \
+ CC="$(CC)"; export CC; \
++ CPP="$(CC) -E"; export CPP; \
+ ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
+ CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index cd5bc4a..98ae4f4 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -762,7 +762,7 @@ BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS)
+ # Native linker and preprocessor flags. For x-fragment overrides.
+ BUILD_LDFLAGS=@BUILD_LDFLAGS@
+ BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
+- -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS)
++ -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS_FOR_BUILD)
+
+ # Actual name to use when installing a native compiler.
+ GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
+diff --git a/gcc/configure b/gcc/configure
+index c7ac14b..5ac63e4 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11521,7 +11521,7 @@ else
+ CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+ CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \
+ LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \
+- GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \
++ GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \
+ ${realsrcdir}/configure \
+ --enable-languages=${enable_languages-all} \
+ --target=$target_alias --host=$build_alias --build=$build_alias
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 50856e6..17a4dfd 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1633,7 +1633,7 @@ else
+ CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+ CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \
+ LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \
+- GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \
++ GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \
+ ${realsrcdir}/configure \
+ --enable-languages=${enable_languages-all} \
+ --target=$target_alias --host=$build_alias --build=$build_alias
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-fix-arm-thumb.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-fix-arm-thumb.patch
new file mode 100644
index 000000000..2f262e3a3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-fix-arm-thumb.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Accepted
+
+Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
+---
+
+2015-11-25 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/67954
+ * lra-constraints.c (curr_insn_transform): Add check on scratch
+ pseudo when change class to NO_REGS. Add an assert.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230894 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+
+diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
+index 4670e81..c62bf6a 100644
+--- a/gcc/lra-constraints.c
++++ b/gcc/lra-constraints.c
+@@ -3725,7 +3725,8 @@ curr_insn_transform (bool check_only_p)
+ assigment pass and the scratch pseudo will be
+ spilled. Spilled scratch pseudos are transformed
+ back to scratches at the LRA end. */
+- && lra_former_scratch_operand_p (curr_insn, i))
++ && lra_former_scratch_operand_p (curr_insn, i)
++ && lra_former_scratch_p (REGNO (op)))
+ {
+ int regno = REGNO (op);
+ lra_change_class (regno, NO_REGS, " Change to", true);
+@@ -3734,6 +3735,8 @@ curr_insn_transform (bool check_only_p)
+ spilled pseudo as there is only one such insn, the
+ current one. */
+ reg_renumber[regno] = -1;
++ lra_assert (bitmap_single_bit_set_p
++ (&lra_reg_info[REGNO (op)].insn_bitmap));
+ }
+ /* We can do an optional reload. If the pseudo got a hard
+ reg, we might improve the code through inheritance. If
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-gcc-musl-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-gcc-musl-support.patch
new file mode 100644
index 000000000..9a0b5ade4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0067-gcc-musl-support.patch
@@ -0,0 +1,267 @@
+# HG changeset patch
+# Parent e5b4564f249f8634194bdabef4b3057d0e54ee97
+Adding -mmusl as a musl libc specifier, and the necessary hacks for it to know how to find musl's dynamic linker.
+Upstream-Status: backport [partial]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+
+Index: gcc-4.9.0/gcc/config.gcc
+===================================================================
+--- gcc-4.9.0.orig/gcc/config.gcc 2014-04-22 22:44:17.153567150 -0700
++++ gcc-4.9.0/gcc/config.gcc 2014-04-23 23:54:31.427357051 -0700
+@@ -594,7 +594,7 @@
+ esac
+
+ # Common C libraries.
+-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
++tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
+
+ # 32-bit x86 processors supported by --with-arch=. Each processor
+ # MUST be separated by exactly one space.
+@@ -719,6 +719,9 @@
+ *-*-*uclibc*)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
+ ;;
++ *-*-*musl*)
++ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
++ ;;
+ *)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
+ ;;
+@@ -2328,6 +2331,11 @@
+ powerpc*-*-linux*paired*)
+ tm_file="${tm_file} rs6000/750cl.h" ;;
+ esac
++ case ${target} in
++ *-linux*-musl*)
++ enable_secureplt=yes ;;
++ esac
++
+ if test x${enable_secureplt} = xyes; then
+ tm_file="rs6000/secureplt.h ${tm_file}"
+ fi
+Index: gcc-4.9.0/gcc/config/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/linux.h 2014-01-02 14:23:26.000000000 -0800
++++ gcc-4.9.0/gcc/config/linux.h 2014-04-24 00:11:29.034028895 -0700
+@@ -32,10 +32,12 @@
+ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
+ #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
+ #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
++#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
+ #else
+ #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
+ #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
+ #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
++#define OPTION_MUSL (linux_libc == LIBC_MUSL)
+ #endif
+
+ #define GNU_USER_TARGET_OS_CPP_BUILTINS() \
+@@ -53,18 +55,21 @@
+ uClibc or Bionic is the default C library and whether
+ -muclibc or -mglibc or -mbionic has been passed to change the default. */
+
+-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
+- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
++#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
++ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
+
+ #if DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
+ #elif DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
+ #elif DEFAULT_LIBC == LIBC_BIONIC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif /* DEFAULT_LIBC */
+@@ -84,16 +89,16 @@
+
+ #define GNU_USER_DYNAMIC_LINKER \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
+- BIONIC_DYNAMIC_LINKER)
++ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+ #define GNU_USER_DYNAMIC_LINKER32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
+- BIONIC_DYNAMIC_LINKER32)
++ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
+- BIONIC_DYNAMIC_LINKER64)
++ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+ #define GNU_USER_DYNAMIC_LINKERX32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
+- BIONIC_DYNAMIC_LINKERX32)
++ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
+
+ /* Whether we have Bionic libc runtime */
+ #undef TARGET_HAS_BIONIC
+@@ -127,3 +132,74 @@
+ # define TARGET_LIBC_HAS_FUNCTION linux_libc_has_function
+
+ #endif
++
++/* musl avoids problematic includes by rearranging the include directories.
++ * Unfortunately, this is mostly duplicated from cppdefault.c */
++#if DEFAULT_LIBC == LIBC_MUSL
++#define INCLUDE_DEFAULTS_MUSL_GPP \
++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
++
++#ifdef LOCAL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_LOCAL \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_LOCAL
++#endif
++
++#ifdef PREFIX_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_PREFIX \
++ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_PREFIX
++#endif
++
++#ifdef CROSS_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_CROSS \
++ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#ifdef TOOL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_TOOL \
++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_TOOL
++#endif
++
++#ifdef NATIVE_SYSTEM_HEADER_DIR
++#define INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_NATIVE
++#endif
++
++#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
++# undef INCLUDE_DEFAULTS_MUSL_LOCAL
++# define INCLUDE_DEFAULTS_MUSL_LOCAL
++# undef INCLUDE_DEFAULTS_MUSL_NATIVE
++# define INCLUDE_DEFAULTS_MUSL_NATIVE
++#else
++# undef INCLUDE_DEFAULTS_MUSL_CROSS
++# define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#undef INCLUDE_DEFAULTS
++#define INCLUDE_DEFAULTS \
++ { \
++ INCLUDE_DEFAULTS_MUSL_GPP \
++ INCLUDE_DEFAULTS_MUSL_PREFIX \
++ INCLUDE_DEFAULTS_MUSL_CROSS \
++ INCLUDE_DEFAULTS_MUSL_TOOL \
++ INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
++ { 0, 0, 0, 0, 0, 0 } \
++ }
++#endif
+Index: gcc-4.9.0/gcc/config/linux.opt
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/linux.opt 2014-01-02 14:23:26.000000000 -0800
++++ gcc-4.9.0/gcc/config/linux.opt 2014-04-22 22:44:17.280233817 -0700
+@@ -30,3 +30,7 @@
+ muclibc
+ Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
+ Use uClibc C library
++
++mmusl
++Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
++Use musl C library
+Index: gcc-4.9.0/gcc/ginclude/stddef.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/ginclude/stddef.h 2014-01-02 14:23:26.000000000 -0800
++++ gcc-4.9.0/gcc/ginclude/stddef.h 2014-04-22 22:44:17.280233817 -0700
+@@ -181,6 +181,7 @@
+ #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
+@@ -197,6 +198,7 @@
+ #define ___int_size_t_h
+ #define _GCC_SIZE_T
+ #define _SIZET_
++#define __DEFINED_size_t /* musl */
+ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
+ || defined(__FreeBSD_kernel__)
+ /* __size_t is a typedef on FreeBSD 5, must not trash it. */
+@@ -214,6 +216,7 @@
+ typedef long ssize_t;
+ #endif /* __BEOS__ */
+ #endif /* !(defined (__GNUG__) && defined (size_t)) */
++#endif /* __DEFINED_size_t */
+ #endif /* __size_t */
+ #endif /* _SIZET_ */
+ #endif /* _GCC_SIZE_T */
+Index: gcc-4.9.0/gcc/config/rs6000/secureplt.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/rs6000/secureplt.h 2014-01-02 14:23:26.000000000 -0800
++++ gcc-4.9.0/gcc/config/rs6000/secureplt.h 2014-04-23 23:55:15.114024175 -0700
+@@ -18,3 +18,4 @@
+ <http://www.gnu.org/licenses/>. */
+
+ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
++#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
+Index: gcc-4.9.0/gcc/config/rs6000/sysv4.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/rs6000/sysv4.h 2014-04-23 23:52:13.854023015 -0700
++++ gcc-4.9.0/gcc/config/rs6000/sysv4.h 2014-04-24 00:10:55.550695334 -0700
+@@ -538,6 +538,10 @@
+ #define CC1_SECURE_PLT_DEFAULT_SPEC ""
+ #endif
+
++#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
++#define LINK_SECURE_PLT_DEFAULT_SPEC ""
++#endif
++
+ /* Pass -G xxx to the compiler. */
+ #define CC1_SPEC "%{G*} %(cc1_cpu)" \
+ "%{meabi: %{!mcall-*: -mcall-sysv }} \
+@@ -585,7 +589,8 @@
+
+ /* Override the default target of the linker. */
+ #define LINK_TARGET_SPEC \
+- ENDIAN_SELECT("", " --oformat elf32-powerpcle", "")
++ ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") \
++ "%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
+
+ /* Any specific OS flags. */
+ #define LINK_OS_SPEC "\
+@@ -894,6 +899,7 @@
+ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
+ { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
+ { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
++ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
+ { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
+ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
+ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0068-musl-dynamic-linker.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0068-musl-dynamic-linker.patch
new file mode 100644
index 000000000..605ac6675
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0068-musl-dynamic-linker.patch
@@ -0,0 +1,205 @@
+# HG changeset patch
+# Parent 6738fd6f6fcc2a72f2ba527bda3325642af26885
+Support for arm-linux-musl.
+Upstream-Status: Backport [partial]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+
+Index: gcc-4.9.2/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/arm/linux-eabi.h
++++ gcc-4.9.2/gcc/config/arm/linux-eabi.h
+@@ -81,6 +81,23 @@
+ #undef TARGET_FIX_V4BX_SPEC
+ #define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}"
+
++/* For ARM musl currently supports four dynamic linkers:
++ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
++ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
++ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
++ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
++ musl does not support the legacy OABI mode.
++ All the dynamic linkers live in /lib.
++ We default to soft-float, EL. */
++#undef MUSL_DYNAMIC_LINKER
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
++#else
++#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
++#endif
++#define MUSL_DYNAMIC_LINKER \
++ SYSTEMLIBS_DIR "ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
++
+ /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
+ use the GNU/Linux version, not the generic BPABI version. */
+ #undef LINK_SPEC
+Index: gcc-4.9.2/libitm/config/arm/hwcap.cc
+===================================================================
+--- gcc-4.9.2.orig/libitm/config/arm/hwcap.cc
++++ gcc-4.9.2/libitm/config/arm/hwcap.cc
+@@ -40,7 +40,11 @@ int GTM_hwcap HIDDEN = 0
+
+ #ifdef __linux__
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <sys/fcntl.h>
++#else
++#include <fcntl.h>
++#endif
+ #include <elf.h>
+
+ static void __attribute__((constructor))
+Index: gcc-4.9.2/gcc/config/i386/linux.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/i386/linux.h
++++ gcc-4.9.2/gcc/config/i386/linux.h
+@@ -21,3 +21,4 @@ along with GCC; see the file COPYING3.
+
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+ #define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
++#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-i386.so.1"
+Index: gcc-4.9.2/gcc/config/i386/linux64.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/i386/linux64.h
++++ gcc-4.9.2/gcc/config/i386/linux64.h
+@@ -30,3 +30,8 @@ see the files COPYING3 and COPYING.RUNTI
+ #define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
+ #define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2"
+ #define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2"
++
++#define MUSL_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-musl-i386.so.1"
++#define MUSL_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-musl-x86_64.so.1"
++#define MUSL_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-musl-x32.so.1"
++
+Index: gcc-4.9.2/gcc/config/mips/linux.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/mips/linux.h
++++ gcc-4.9.2/gcc/config/mips/linux.h
+@@ -23,3 +23,6 @@ along with GCC; see the file COPYING3.
+ #undef UCLIBC_DYNAMIC_LINKER
+ #define UCLIBC_DYNAMIC_LINKER \
+ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
++
++#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-mips.so.1"
++
+Index: gcc-4.9.2/gcc/config/mips/linux64.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/mips/linux64.h
++++ gcc-4.9.2/gcc/config/mips/linux64.h
+@@ -39,6 +39,11 @@ along with GCC; see the file COPYING3.
+ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
++
++#define MUSL_DYNAMIC_LINKERN32 SYSTEMLIBS_DIR "ld-musl-mips.so.1"
++#define MUSL_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-musl-mips.so.1"
++#define MUSL_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-musl-mips.so.1"
++
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
+- BIONIC_DYNAMIC_LINKERN32)
++ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
+Index: gcc-4.9.2/gcc/config/rs6000/linux64.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/rs6000/linux64.h
++++ gcc-4.9.2/gcc/config/rs6000/linux64.h
+@@ -375,17 +375,22 @@ extern int dot_symbols;
+ #endif
+ #define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
+ #define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
++#define MUSL_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-musl-powerpc.so.1"
++#define MUSL_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-musl-powerpc64.so.1"
++
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER32 \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64 \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+
+ #undef DEFAULT_ASM_ENDIAN
+ #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
+Index: gcc-4.9.2/gcc/config/rs6000/sysv4.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/rs6000/sysv4.h
++++ gcc-4.9.2/gcc/config/rs6000/sysv4.h
+@@ -768,15 +768,19 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+ #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
++
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+
+ #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+Index: gcc-4.9.2/libitm/config/linux/x86/tls.h
+===================================================================
+--- gcc-4.9.2.orig/libitm/config/linux/x86/tls.h
++++ gcc-4.9.2/libitm/config/linux/x86/tls.h
+@@ -25,16 +25,19 @@
+ #ifndef LIBITM_X86_TLS_H
+ #define LIBITM_X86_TLS_H 1
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ /* Use slots in the TCB head rather than __thread lookups.
+ GLIBC has reserved words 10 through 13 for TM. */
+ #define HAVE_ARCH_GTM_THREAD 1
+ #define HAVE_ARCH_GTM_THREAD_DISP 1
+ #endif
++#endif
+
+ #include "config/generic/tls.h"
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ namespace GTM HIDDEN {
+
+ #ifdef __x86_64__
+@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct a
+
+ } // namespace GTM
+ #endif /* >= GLIBC 2.10 */
++#endif
+
+ #endif // LIBITM_X86_TLS_H
+Index: gcc-4.9.2/gcc/config/aarch64/aarch64-linux.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/aarch64/aarch64-linux.h
++++ gcc-4.9.2/gcc/config/aarch64/aarch64-linux.h
+@@ -25,6 +25,8 @@
+
+ #define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
++#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-aarch64.so.1"
++
+ #define LINUX_TARGET_LINK_SPEC "%{h*} \
+ %{static:-Bstatic} \
+ %{shared:-shared} \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0069-musl-no-fixincludes.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0069-musl-no-fixincludes.patch
new file mode 100644
index 000000000..e2b18a402
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0069-musl-no-fixincludes.patch
@@ -0,0 +1,21 @@
+# HG changeset patch
+# Parent 600a8a422ccaf5627ad1f5a138e7398df2b9e9d8
+Get rid of ever-broken fixincludes on musl.
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+
+Index: gcc-4.9-20140316/fixincludes/mkfixinc.sh
+===================================================================
+--- gcc-4.9-20140316.orig/fixincludes/mkfixinc.sh
++++ gcc-4.9-20140316/fixincludes/mkfixinc.sh
+@@ -19,7 +19,8 @@ case $machine in
+ powerpc-*-eabi* | \
+ powerpc-*-rtems* | \
+ powerpcle-*-eabisim* | \
+- powerpcle-*-eabi* )
++ powerpcle-*-eabi* | \
++ *-musl* )
+ # IF there is no include fixing,
+ # THEN create a no-op fixer and exit
+ (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0070-libstdc-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0070-libstdc-musl.patch
new file mode 100644
index 000000000..048e481dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0070-libstdc-musl.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: gcc-4.9-20140316/libstdc++-v3/configure.host
+===================================================================
+--- gcc-4.9-20140316.orig/libstdc++-v3/configure.host 2014-03-26 01:12:19.466008193 -0700
++++ gcc-4.9-20140316/libstdc++-v3/configure.host 2014-03-26 01:43:48.222684357 -0700
+@@ -264,14 +264,24 @@
+ os_include_dir="os/bsd/freebsd"
+ ;;
+ gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
++ # check for musl by target
++ case "${host_os}" in
++ *-musl*)
++ os_include_dir="os/generic"
++ ;;
++ *)
+ if [ "$uclibc" = "yes" ]; then
+ os_include_dir="os/uclibc"
+ elif [ "$bionic" = "yes" ]; then
+ os_include_dir="os/bionic"
++ elif [ "$musl" = "yes" ]; then
++ os_include_dir="os/generic"
+ else
+ os_include_dir="os/gnu-linux"
+ fi
+ ;;
++ esac
++ ;;
+ hpux*)
+ os_include_dir="os/hpux"
+ ;;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
new file mode 100644
index 000000000..e8f79b590
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0071-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
@@ -0,0 +1,31 @@
+From 32593b38082ea65f4c82159254adf1e0dc2423be Mon Sep 17 00:00:00 2001
+From: bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 16 Feb 2016 03:15:15 -0500
+Subject: [PATCH] Ignore -fdebug-prefix-map in producer string (by Daniel Kahn
+ Gillmor)
+
+* dwarf2out.c (gen_producer_string): Ignore -fdebug-prefix-map.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231835 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/dwarf2out.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index 3614c10..526f114 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19670,6 +19670,7 @@ gen_producer_string (void)
+ case OPT_fpreprocessed:
+ case OPT_fltrans_output_list_:
+ case OPT_fresolution_:
++ case OPT_fdebug_prefix_map_:
+ /* Ignore these. */
+ continue;
+ default:
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch
new file mode 100644
index 000000000..9809a6a22
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0072-support-ffile-prefix-map.patch
@@ -0,0 +1,284 @@
+From e863be798ed13312a0faf0b961275f211a8123ab Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 17 Mar 2016 00:32:17 -0400
+Subject: [PATCH] gcc/libcpp: support -ffile-prefix-map=<old>=<new>
+
+Similar -fdebug-prefix-map, add option -ffile-prefix-map to map one
+directory name (old) to another (new) in __FILE__, __BASE_FILE__ and
+__builtin_FILE ().
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
+
+Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/c-family/c-opts.c | 6 ++++
+ gcc/c-family/c.opt | 4 +++
+ gcc/dwarf2out.c | 1 +
+ gcc/gimplify.c | 2 ++
+ libcpp/Makefile.in | 10 +++---
+ libcpp/file-map.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++
+ libcpp/include/file-map.h | 30 ++++++++++++++++
+ libcpp/macro.c | 2 ++
+ 8 files changed, 142 insertions(+), 5 deletions(-)
+ create mode 100644 libcpp/file-map.c
+ create mode 100644 libcpp/include/file-map.h
+
+diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
+index dd5fd23..9c004a1 100644
+--- a/gcc/c-family/c-opts.c
++++ b/gcc/c-family/c-opts.c
+@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "options.h"
+ #include "plugin.h" /* For PLUGIN_INCLUDE_FILE event. */
+ #include "mkdeps.h"
++#include "file-map.h"
+ #include "c-target.h"
+ #include "tm.h" /* For BYTES_BIG_ENDIAN,
+ DOLLARS_IN_IDENTIFIERS,
+@@ -553,6 +554,11 @@ c_common_handle_option (size_t scode, const char *arg, int value,
+ cpp_opts->narrow_charset = arg;
+ break;
+
++ case OPT_ffile_prefix_map_:
++ if (add_file_prefix_map (arg) < 0)
++ error ("invalid argument %qs to -ffile-prefix-map", arg);
++ break;
++
+ case OPT_fwide_exec_charset_:
+ cpp_opts->wide_charset = arg;
+ break;
+diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
+index f295805..3a99662 100644
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -928,6 +928,10 @@ fexec-charset=
+ C ObjC C++ ObjC++ Joined RejectNegative
+ -fexec-charset=<cset> Convert all strings and character constants to character set <cset>
+
++ffile-prefix-map=
++C ObjC C++ ObjC++ Joined RejectNegative
++-ffile-prefix-map=<old=new> Map one directory name to another in __FILE__, __BASE_FILE__ and __builtin_FILE ()
++
+ fextended-identifiers
+ C ObjC C++ ObjC++
+ Permit universal character names (\\u and \\U) in identifiers
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index 99bf6e2..3e58cfd 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19199,6 +19199,7 @@ gen_producer_string (void)
+ case OPT_fltrans_output_list_:
+ case OPT_fresolution_:
+ case OPT_fdebug_prefix_map_:
++ case OPT_ffile_prefix_map_:
+ /* Ignore these. */
+ continue;
+ default:
+diff --git a/gcc/gimplify.c b/gcc/gimplify.c
+index 89e7334..a7a97c0 100644
+--- a/gcc/gimplify.c
++++ b/gcc/gimplify.c
+@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "omp-low.h"
+ #include "gimple-low.h"
+ #include "cilk.h"
++#include "file-map.h"
+
+ #include "langhooks-def.h" /* FIXME: for lhd_set_decl_assembler_name */
+ #include "tree-pass.h" /* FIXME: only for PROP_gimple_any */
+@@ -2288,6 +2289,7 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
+ case BUILT_IN_FILE:
+ {
+ expanded_location loc = expand_location (EXPR_LOCATION (*expr_p));
++ loc.file = remap_file_filename (loc.file);
+ *expr_p = build_string_literal (strlen (loc.file) + 1, loc.file);
+ return GS_OK;
+ }
+diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in
+index 5561c97..5017256 100644
+--- a/libcpp/Makefile.in
++++ b/libcpp/Makefile.in
+@@ -84,12 +84,12 @@ DEPMODE = $(CXXDEPMODE)
+
+
+ libcpp_a_OBJS = charset.o directives.o directives-only.o errors.o \
+- expr.o files.o identifiers.o init.o lex.o line-map.o macro.o \
+- mkdeps.o pch.o symtab.o traditional.o
++ expr.o file-map.o files.o identifiers.o init.o lex.o line-map.o \
++ macro.o mkdeps.o pch.o symtab.o traditional.o
+
+ libcpp_a_SOURCES = charset.c directives.c directives-only.c errors.c \
+- expr.c files.c identifiers.c init.c lex.c line-map.c macro.c \
+- mkdeps.c pch.c symtab.c traditional.c
++ expr.c file-map.c files.c identifiers.c init.c lex.c line-map.c \
++ macro.c mkdeps.c pch.c symtab.c traditional.c
+
+ all: libcpp.a $(USED_CATALOGS)
+
+@@ -263,7 +263,7 @@ po/$(PACKAGE).pot: $(libcpp_a_SOURCES)
+
+ TAGS_SOURCES = $(libcpp_a_SOURCES) internal.h ucnid.h \
+ include/line-map.h include/symtab.h include/cpp-id-data.h \
+- include/cpplib.h include/mkdeps.h system.h
++ include/cpplib.h include/mkdeps.h system.h include/file-map.h
+
+ TAGS: $(TAGS_SOURCES)
+ cd $(srcdir) && etags $(TAGS_SOURCES)
+diff --git a/libcpp/file-map.c b/libcpp/file-map.c
+new file mode 100644
+index 0000000..04e851b
+--- /dev/null
++++ b/libcpp/file-map.c
+@@ -0,0 +1,92 @@
++/* Map one directory name to another in __FILE__, __BASE_FILE__
++ and __builtin_FILE ().
++ Copyright (C) 2001-2016 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; see the file COPYING3. If not see
++<http://www.gnu.org/licenses/>.
++
++ In other words, you are welcome to use, share and improve this program.
++ You are forbidden to forbid anyone else to use, share and improve
++ what you give them. Help stamp out software-hoarding! */
++
++#include "config.h"
++#include "system.h"
++#include "file-map.h"
++
++/* Structure recording the mapping from source file and directory
++ names at compile time to __FILE__ */
++typedef struct file_prefix_map
++{
++ const char *old_prefix;
++ const char *new_prefix;
++ size_t old_len;
++ size_t new_len;
++ struct file_prefix_map *next;
++} file_prefix_map;
++
++/* Linked list of such structures. */
++static file_prefix_map *file_prefix_maps;
++
++/* Record prefix mapping of __FILE__. ARG is the argument to
++ -ffile-prefix-map and must be of the form OLD=NEW. */
++int
++add_file_prefix_map (const char *arg)
++{
++ file_prefix_map *map;
++ const char *p;
++
++ p = strchr (arg, '=');
++ if (!p)
++ {
++ fprintf(stderr, "invalid argument %qs to -ffile-prefix-map", arg);
++ return -1;
++ }
++ map = XNEW (file_prefix_map);
++ map->old_prefix = xstrndup (arg, p - arg);
++ map->old_len = p - arg;
++ p++;
++ map->new_prefix = xstrdup (p);
++ map->new_len = strlen (p);
++ map->next = file_prefix_maps;
++ file_prefix_maps = map;
++
++ return 0;
++}
++
++/* Perform user-specified mapping of __FILE__ prefixes. Return
++ the new name corresponding to filename. */
++
++const char *
++remap_file_filename (const char *filename)
++{
++ file_prefix_map *map;
++ char *s;
++ const char *name;
++ size_t name_len;
++
++ for (map = file_prefix_maps; map; map = map->next)
++ if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
++ break;
++ if (!map)
++ return filename;
++ name = filename + map->old_len;
++ name_len = strlen (name) + 1;
++ s = (char *) alloca (name_len + map->new_len);
++ memcpy (s, map->new_prefix, map->new_len);
++ memcpy (s + map->new_len, name, name_len);
++
++ return xstrdup (s);
++}
++
++
+diff --git a/libcpp/include/file-map.h b/libcpp/include/file-map.h
+new file mode 100644
+index 0000000..e6f8cbf
+--- /dev/null
++++ b/libcpp/include/file-map.h
+@@ -0,0 +1,30 @@
++/* Map one directory name to another in __FILE__, __BASE_FILE__
++ and __builtin_FILE ().
++ Copyright (C) 2001-2016 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; see the file COPYING3. If not see
++<http://www.gnu.org/licenses/>.
++
++ In other words, you are welcome to use, share and improve this program.
++ You are forbidden to forbid anyone else to use, share and improve
++ what you give them. Help stamp out software-hoarding! */
++
++#ifndef LIBCPP_FILE_MAP_H
++#define LIBCPP_FILE_MAP_H
++
++const char * remap_file_filename (const char *filename);
++
++int add_file_prefix_map (const char *arg);
++
++#endif /* !LIBCPP_FILE_MAP_H */
+diff --git a/libcpp/macro.c b/libcpp/macro.c
+index 11e50f4..5c6f90e 100644
+--- a/libcpp/macro.c
++++ b/libcpp/macro.c
+@@ -26,6 +26,7 @@ along with this program; see the file COPYING3. If not see
+ #include "system.h"
+ #include "cpplib.h"
+ #include "internal.h"
++#include "file-map.h"
+
+ typedef struct macro_arg macro_arg;
+ /* This structure represents the tokens of a macro argument. These
+@@ -288,6 +289,7 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node)
+ if (!name)
+ abort ();
+ }
++ name = remap_file_filename (name);
+ len = strlen (name);
+ buf = _cpp_unaligned_alloc (pfile, len * 2 + 3);
+ result = buf;
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
new file mode 100644
index 000000000..94e45ed0a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
@@ -0,0 +1,43 @@
+From 5e10baff84038d26dc3d59b2412ba1db92cb8274 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 17 Mar 2016 00:34:01 -0400
+Subject: [PATCH 2/2] Reuse -fdebug-prefix-map to replace -ffile-prefix-map
+
+The oe-core may use external toolchain to compile,
+which may not support -ffile-prefix-map.
+
+Since we use -fdebug-prefix-map to do the same thing,
+so we could reuse it to replace -ffile-prefix-map.
+
+Upstream-Status: Inappropriate[oe-core specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/opts-global.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/gcc/opts-global.c b/gcc/opts-global.c
+index 111884b..037f6c8 100644
+--- a/gcc/opts-global.c
++++ b/gcc/opts-global.c
+@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "toplev.h"
+ #include "tree-pass.h"
+ #include "context.h"
++#include "file-map.h"
+
+ typedef const char *const_char_p; /* For DEF_VEC_P. */
+
+@@ -354,6 +355,9 @@ handle_common_deferred_options (void)
+
+ case OPT_fdebug_prefix_map_:
+ add_debug_prefix_map (opt->arg);
++
++ /* Reuse -fdebug-prefix-map to replace -ffile-prefix-map */
++ add_file_prefix_map (opt->arg);
+ break;
+
+ case OPT_fdump_:
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0074-fdebug-prefix-map-support-to-remap-relative-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0074-fdebug-prefix-map-support-to-remap-relative-path.patch
new file mode 100644
index 000000000..0b91fdbbc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-4.9/0074-fdebug-prefix-map-support-to-remap-relative-path.patch
@@ -0,0 +1,51 @@
+From 289ad2969a5966c603bf6928ce442db74c4cbb25 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 24 Mar 2016 11:23:14 -0400
+Subject: [PATCH] gcc/final.c: -fdebug-prefix-map support to remap sources with
+ relative path
+
+PR other/70428
+* final.c (remap_debug_filename): Use lrealpath to translate
+relative path before remapping
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70428
+Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+diff --git a/gcc/final.c b/gcc/final.c
+index 55cf509..c3594c2 100644
+--- a/gcc/final.c
++++ b/gcc/final.c
+@@ -1554,16 +1554,25 @@ remap_debug_filename (const char *filename)
+ const char *name;
+ size_t name_len;
+
++ /* Support to remap filename with relative path */
++ char *realpath = lrealpath (filename);
++ if (realpath == NULL)
++ return filename;
++
+ for (map = debug_prefix_maps; map; map = map->next)
+- if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
++ if (filename_ncmp (realpath, map->old_prefix, map->old_len) == 0)
+ break;
+ if (!map)
+- return filename;
+- name = filename + map->old_len;
++ {
++ free (realpath);
++ return filename;
++ }
++ name = realpath + map->old_len;
+ name_len = strlen (name) + 1;
+ s = (char *) alloca (name_len + map->new_len);
+ memcpy (s, map->new_prefix, map->new_len);
+ memcpy (s + map->new_len, name, name_len);
++ free (realpath);
+ return ggc_strdup (s);
+ }
+
+--
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3.inc
new file mode 100644
index 000000000..9808be113
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3.inc
@@ -0,0 +1,143 @@
+require gcc-common.inc
+
+# Third digit in PV should be incremented after a minor release
+
+PV = "5.3.0"
+
+#SNAP = "5-20150405"
+
+# BINV should be incremented to a revision after a minor gcc release
+
+BINV = "5.3.0"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-5.3:${FILE_DIRNAME}/gcc-5.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 = "http://www.netgull.com/gcc/snapshots/${SNAP}/gcc-${SNAP}.tar.bz2"
+BASEURI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2"
+
+SRC_URI = "\
+ ${BASEURI} \
+ ${BACKPORTS} \
+ 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-libgcc-sjlj-check.patch \
+ file://0020-cpp-honor-sysroot.patch \
+ file://0021-MIPS64-Default-to-N64-ABI.patch \
+ file://0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
+ file://0023-gcc-Fix-argument-list-too-long-error.patch \
+ file://0024-Disable-sdt.patch \
+ file://0025-libtool.patch \
+ file://0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
+ file://0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
+ file://0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch \
+ file://0029-export-CPP.patch \
+ file://0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
+ file://0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch \
+ file://0032-Ensure-target-gcc-headers-can-be-included.patch \
+ file://0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch \
+ file://0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch \
+ file://0035-Dont-link-the-plugins-with-libgomp-explicitly.patch \
+ file://0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch \
+ file://0037-aarch64-Add-support-for-musl-ldso.patch \
+ file://0038-fix-g-sysroot.patch \
+ file://0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch \
+ file://0040-handle-sysroot-support-for-nativesdk-gcc.patch \
+ file://0041-Search-target-sysroot-gcc-version-specific-dirs-with.patch \
+ file://0042-Fix-various-_FOR_BUILD-and-related-variables.patch \
+ file://0043-libstdc-Support-musl.patch \
+ file://0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch \
+ file://0045-Support-for-arm-linux-musl.patch \
+ file://0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch \
+ file://0047-nios2-Define-MUSL_DYNAMIC_LINKER.patch \
+ file://0048-ssp_nonshared.patch \
+ file://0049-Disable-the-weak-reference-logic-in-gthr.h-for-os-ge.patch \
+ file://0050-powerpc-pass-secure-plt-to-the-linker.patch \
+ file://0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch \
+ file://0052-nios2-use-ret-with-r31.patch \
+ file://0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch \
+ file://0054-support-ffile-prefix-map.patch \
+ file://0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
+ file://0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch \
+ file://0057-unwind-fix-for-musl.patch \
+ file://0058-fdebug-prefix-map-support-to-remap-relative-path.patch \
+"
+
+BACKPORTS = ""
+
+SRC_URI[md5sum] = "c9616fd448f980259c31de613e575719"
+SRC_URI[sha256sum] = "b84f5592e9218b73dbae612b5253035a7b34a9a1f7688d2e1bfaaf7267d5c4db"
+
+#S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${SNAP}"
+S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+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-5.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
new file mode 100644
index 000000000..1aead9691
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
@@ -0,0 +1,42 @@
+From 6029bb338305a5d1403ee23427ed8d58eae1ff53 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:37:11 +0400
+Subject: [PATCH 01/46] gcc-4.3.1: ARCH_FLAGS_FOR_TARGET
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ configure | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index a3f66ba..1cba3a9 100755
+--- a/configure
++++ b/configure
+@@ -7464,7 +7464,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $target_configargs " in
+diff --git a/configure.ac b/configure.ac
+index 987dfab..d3adb95 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3104,7 +3104,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $target_configargs " in
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0002-uclibc-conf.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0002-uclibc-conf.patch
new file mode 100644
index 000000000..8d6aeb5e4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0002-uclibc-conf.patch
@@ -0,0 +1,53 @@
+From b67c3a844bccec1766a7ec120e2d18cdcbc5f114 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:38:25 +0400
+Subject: [PATCH 02/46] uclibc-conf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ contrib/regression/objs-gcc.sh | 4 ++++
+ libjava/classpath/ltconfig | 4 ++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh
+index 60b0497..6dc7ead 100755
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ]
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+diff --git a/libjava/classpath/ltconfig b/libjava/classpath/ltconfig
+index 743d951..ae4ea60 100755
+--- a/libjava/classpath/ltconfig
++++ b/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0003-gcc-uclibc-locale-ctype_touplow_t.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0003-gcc-uclibc-locale-ctype_touplow_t.patch
new file mode 100644
index 000000000..bd0326343
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0003-gcc-uclibc-locale-ctype_touplow_t.patch
@@ -0,0 +1,87 @@
+From 9bcb3a1848ff0f8990301ca09a25b15c2cf90c6f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:40:12 +0400
+Subject: [PATCH 03/46] gcc-uclibc-locale-ctype_touplow_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/generic/c_locale.cc | 5 +++++
+ libstdc++-v3/config/locale/generic/c_locale.h | 9 +++++++++
+ libstdc++-v3/config/os/gnu-linux/ctype_base.h | 9 +++++++++
+ 3 files changed, 23 insertions(+)
+
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
+index 6da5f22..2f85c2f 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.cc
++++ b/libstdc++-v3/config/locale/generic/c_locale.cc
+@@ -263,5 +263,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
+ #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
+ #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
+ extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
++#ifdef __UCLIBC__
++// This is because __c_locale is of type __ctype_touplow_t* which is short on uclibc. for glibc its int*
++_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPs, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPs);
++#else
+ _GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi);
++#endif
+ #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.h b/libstdc++-v3/config/locale/generic/c_locale.h
+index ee3ef86..7fd5485 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.h
++++ b/libstdc++-v3/config/locale/generic/c_locale.h
+@@ -40,13 +40,22 @@
+
+ #include <clocale>
+
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ #define _GLIBCXX_NUM_CATEGORIES 0
+
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
++#ifdef __UCLIBC__
++ typedef __ctype_touplow_t* __c_locale;
++#else
+ typedef int* __c_locale;
++#endif
+
+ // Convert numeric value of type double and long double to string and
+ // return length of string. If vsnprintf is available use it, otherwise
+diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_base.h b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+index fd52b73..2627cf3 100644
+--- a/libstdc++-v3/config/os/gnu-linux/ctype_base.h
++++ b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+@@ -33,6 +33,11 @@
+
+ // Information as gleaned from /usr/include/ctype.h
+
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -41,7 +46,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ struct ctype_base
+ {
+ // Non-standard typedefs.
++#ifdef __UCLIBC__
++ typedef const __ctype_touplow_t* __to_type;
++#else
+ typedef const int* __to_type;
++#endif
+
+ // NB: Offsets into ctype<char>::_M_table force a particular size
+ // on the mask type. Because of this, we don't use an enum.
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0004-uclibc-locale.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0004-uclibc-locale.patch
new file mode 100644
index 000000000..656265a28
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0004-uclibc-locale.patch
@@ -0,0 +1,2862 @@
+From bd9dd472d162fc72522f96f70f6391c7c63d2bf7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:41:39 +0400
+Subject: [PATCH 04/46] uclibc-locale
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/acinclude.m4 | 37 ++
+ .../config/locale/uclibc/c++locale_internal.h | 63 ++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc | 160 +++++
+ libstdc++-v3/config/locale/uclibc/c_locale.h | 117 ++++
+ .../config/locale/uclibc/codecvt_members.cc | 308 +++++++++
+ .../config/locale/uclibc/collate_members.cc | 80 +++
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 300 +++++++++
+ .../config/locale/uclibc/messages_members.cc | 100 +++
+ .../config/locale/uclibc/messages_members.h | 118 ++++
+ .../config/locale/uclibc/monetary_members.cc | 692 +++++++++++++++++++++
+ .../config/locale/uclibc/numeric_members.cc | 160 +++++
+ libstdc++-v3/config/locale/uclibc/time_members.cc | 406 ++++++++++++
+ libstdc++-v3/config/locale/uclibc/time_members.h | 68 ++
+ libstdc++-v3/configure | 75 +++
+ libstdc++-v3/include/c_compatibility/wchar.h | 2 +
+ libstdc++-v3/include/c_std/cwchar | 2 +
+ 16 files changed, 2688 insertions(+)
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/collate_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/ctype_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/monetary_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/numeric_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.h
+
+diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
+index 826ef86..79cc716 100644
+--- a/libstdc++-v3/acinclude.m4
++++ b/libstdc++-v3/acinclude.m4
+@@ -2029,6 +2029,9 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ *-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ enable_clocale_flag=gnu
+ ;;
+@@ -2213,6 +2216,40 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ AC_MSG_RESULT(uclibc)
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++ AC_SUBST(glibcxx_MOFILES)
++ AC_SUBST(glibcxx_POFILES)
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+new file mode 100644
+index 0000000..2ae3e4a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -0,0 +1,63 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <bits/c++config.h>
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
++extern "C" __typeof(strcoll_l) __strcoll_l;
++extern "C" __typeof(strftime_l) __strftime_l;
++extern "C" __typeof(strtod_l) __strtod_l;
++extern "C" __typeof(strtof_l) __strtof_l;
++extern "C" __typeof(strtold_l) __strtold_l;
++extern "C" __typeof(strxfrm_l) __strxfrm_l;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++extern "C" __typeof(iswctype_l) __iswctype_l;
++extern "C" __typeof(towlower_l) __towlower_l;
++extern "C" __typeof(towupper_l) __towupper_l;
++extern "C" __typeof(wcscoll_l) __wcscoll_l;
++extern "C" __typeof(wcsftime_l) __wcsftime_l;
++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
++extern "C" __typeof(wctype_l) __wctype_l;
++#endif
++
++#endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+new file mode 100644
+index 0000000..5081dc1
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -0,0 +1,160 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <cerrno> // For errno
++#include <locale>
++#include <stdexcept>
++#include <langinfo.h>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
++#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
++#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
++#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
++#define __strtof_l(S, E, L) strtof((S), (E))
++#define __strtod_l(S, E, L) strtod((S), (E))
++#define __strtold_l(S, E, L) strtold((S), (E))
++#warning should dummy __newlocale check for C|POSIX ?
++#define __newlocale(a, b, c) NULL
++#define __freelocale(a) ((void)0)
++#define __duplocale(a) __c_locale()
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __f;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __d;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __ld;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ void
++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
++ __c_locale __old)
++ {
++ __cloc = __newlocale(1 << LC_ALL, __s, __old);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ if (!__cloc)
++ {
++ // This named locale is not supported by the underlying OS.
++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
++ "name not valid"));
++ }
++#endif
++ }
++
++ void
++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
++ {
++ if (_S_get_c_locale() != __cloc)
++ __freelocale(__cloc);
++ }
++
++ __c_locale
++ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
++ { return __duplocale(__cloc); }
++} // namespace std
++
++namespace __gnu_cxx
++{
++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
++ {
++ "LC_CTYPE",
++ "LC_NUMERIC",
++ "LC_TIME",
++ "LC_COLLATE",
++ "LC_MONETARY",
++ "LC_MESSAGES",
++#if _GLIBCXX_NUM_CATEGORIES != 0
++ "LC_PAPER",
++ "LC_NAME",
++ "LC_ADDRESS",
++ "LC_TELEPHONE",
++ "LC_MEASUREMENT",
++ "LC_IDENTIFICATION"
++#endif
++ };
++}
++
++namespace std
++{
++ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
++} // namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+new file mode 100644
+index 0000000..da07c1f
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -0,0 +1,117 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifndef _C_LOCALE_H
++#define _C_LOCALE_H 1
++
++#pragma GCC system_header
++
++#include <cstring> // get std::strlen
++#include <cstdio> // get std::snprintf or std::sprintf
++#include <clocale>
++#include <langinfo.h> // For codecvt
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC_HAS_LOCALE__
++#include <iconv.h> // For codecvt using iconv, iconv_t
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#include <libintl.h> // For messages
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning what is _GLIBCXX_C_LOCALE_GNU for
++#endif
++#define _GLIBCXX_C_LOCALE_GNU 1
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix categories
++#endif
++// #define _GLIBCXX_NUM_CATEGORIES 6
++#define _GLIBCXX_NUM_CATEGORIES 0
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++namespace __gnu_cxx
++{
++ extern "C" __typeof(uselocale) __uselocale;
++}
++#endif
++
++namespace std
++{
++#ifdef __UCLIBC_HAS_XLOCALE__
++ typedef __locale_t __c_locale;
++#else
++ typedef int* __c_locale;
++#endif
++
++ // Convert numeric value of type _Tv to string and return length of
++ // string. If snprintf is available use it, otherwise fall back to
++ // the unsafe sprintf which, in general, can be dangerous and should
++ // be avoided.
++ template<typename _Tv>
++ int
++ __convert_from_v(char* __out,
++ const int __size __attribute__ ((__unused__)),
++ const char* __fmt,
++#ifdef __UCLIBC_HAS_XCLOCALE__
++ _Tv __v, const __c_locale& __cloc, int __prec)
++ {
++ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++ _Tv __v, const __c_locale&, int __prec)
++ {
++# ifdef __UCLIBC_HAS_LOCALE__
++ char* __old = std::setlocale(LC_ALL, NULL);
++ char* __sav = new char[std::strlen(__old) + 1];
++ std::strcpy(__sav, __old);
++ std::setlocale(LC_ALL, "C");
++# endif
++#endif
++
++ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++
++#ifdef __UCLIBC_HAS_XCLOCALE__
++ __gnu_cxx::__uselocale(__old);
++#elif defined __UCLIBC_HAS_LOCALE__
++ std::setlocale(LC_ALL, __sav);
++ delete [] __sav;
++#endif
++ return __ret;
++ }
++}
++
++#endif
+diff --git a/libstdc++-v3/config/locale/uclibc/codecvt_members.cc b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+new file mode 100644
+index 0000000..64aa962
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+@@ -0,0 +1,308 @@
++// std::codecvt implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <cstdlib> // For MB_CUR_MAX
++#include <climits> // For MB_LEN_MAX
++#include <bits/c++locale_internal.h>
++
++namespace std
++{
++ // Specializations.
++#ifdef _GLIBCXX_USE_WCHAR_T
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ do_out(state_type& __state, const intern_type* __from,
++ const intern_type* __from_end, const intern_type*& __from_next,
++ extern_type* __to, extern_type* __to_end,
++ extern_type*& __to_next) const
++ {
++ result __ret = ok;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
++ // in case we fall back to wcrtomb and then continue, in a loop.
++ // NB: wcsnrtombs is a GNU extension
++ for (__from_next = __from, __to_next = __to;
++ __from_next < __from_end && __to_next < __to_end
++ && __ret == ok;)
++ {
++ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
++ __from_end - __from_next);
++ if (!__from_chunk_end)
++ __from_chunk_end = __from_end;
++
++ __from = __from_next;
++ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
++ __from_chunk_end - __from_next,
++ __to_end - __to_next, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // wcrtomb.
++ for (; __from < __from_next; ++__from)
++ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
++ __state = __tmp_state;
++ __ret = error;
++ }
++ else if (__from_next && __from_next < __from_chunk_end)
++ {
++ __to_next += __conv;
++ __ret = partial;
++ }
++ else
++ {
++ __from_next = __from_chunk_end;
++ __to_next += __conv;
++ }
++
++ if (__from_next < __from_end && __ret == ok)
++ {
++ extern_type __buf[MB_LEN_MAX];
++ __tmp_state = __state;
++ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
++ if (__conv > static_cast<size_t>(__to_end - __to_next))
++ __ret = partial;
++ else
++ {
++ memcpy(__to_next, __buf, __conv);
++ __state = __tmp_state;
++ __to_next += __conv;
++ ++__from_next;
++ }
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ do_in(state_type& __state, const extern_type* __from,
++ const extern_type* __from_end, const extern_type*& __from_next,
++ intern_type* __to, intern_type* __to_end,
++ intern_type*& __to_next) const
++ {
++ result __ret = ok;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++ // in case we store a L'\0' and then continue, in a loop.
++ // NB: mbsnrtowcs is a GNU extension
++ for (__from_next = __from, __to_next = __to;
++ __from_next < __from_end && __to_next < __to_end
++ && __ret == ok;)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
++ __from_end
++ - __from_next));
++ if (!__from_chunk_end)
++ __from_chunk_end = __from_end;
++
++ __from = __from_next;
++ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
++ __from_chunk_end - __from_next,
++ __to_end - __to_next, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // mbrtowc.
++ for (;; ++__to_next, __from += __conv)
++ {
++ __conv = mbrtowc(__to_next, __from, __from_end - __from,
++ &__tmp_state);
++ if (__conv == static_cast<size_t>(-1)
++ || __conv == static_cast<size_t>(-2))
++ break;
++ }
++ __from_next = __from;
++ __state = __tmp_state;
++ __ret = error;
++ }
++ else if (__from_next && __from_next < __from_chunk_end)
++ {
++ // It is unclear what to return in this case (see DR 382).
++ __to_next += __conv;
++ __ret = partial;
++ }
++ else
++ {
++ __from_next = __from_chunk_end;
++ __to_next += __conv;
++ }
++
++ if (__from_next < __from_end && __ret == ok)
++ {
++ if (__to_next < __to_end)
++ {
++ // XXX Probably wrong for stateful encodings
++ __tmp_state = __state;
++ ++__from_next;
++ *__to_next++ = L'\0';
++ }
++ else
++ __ret = partial;
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_encoding() const throw()
++ {
++ // XXX This implementation assumes that the encoding is
++ // stateless and is either single-byte or variable-width.
++ int __ret = 0;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++ if (MB_CUR_MAX == 1)
++ __ret = 1;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_max_length() const throw()
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++ // XXX Probably wrong for stateful encodings.
++ int __ret = MB_CUR_MAX;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_length(state_type& __state, const extern_type* __from,
++ const extern_type* __end, size_t __max) const
++ {
++ int __ret = 0;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++ // in case we advance past it and then continue, in a loop.
++ // NB: mbsnrtowcs is a GNU extension
++
++ // A dummy internal buffer is needed in order for mbsnrtocws to consider
++ // its fourth parameter (it wouldn't with NULL as first parameter).
++ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
++ * __max));
++ while (__from < __end && __max)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
++ __end
++ - __from));
++ if (!__from_chunk_end)
++ __from_chunk_end = __end;
++
++ const extern_type* __tmp_from = __from;
++ size_t __conv = mbsnrtowcs(__to, &__from,
++ __from_chunk_end - __from,
++ __max, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // mbrtowc.
++ for (__from = __tmp_from;; __from += __conv)
++ {
++ __conv = mbrtowc(NULL, __from, __end - __from,
++ &__tmp_state);
++ if (__conv == static_cast<size_t>(-1)
++ || __conv == static_cast<size_t>(-2))
++ break;
++ }
++ __state = __tmp_state;
++ __ret += __from - __tmp_from;
++ break;
++ }
++ if (!__from)
++ __from = __from_chunk_end;
++
++ __ret += __from - __tmp_from;
++ __max -= __conv;
++
++ if (__from < __end && __max)
++ {
++ // XXX Probably wrong for stateful encodings
++ __tmp_state = __state;
++ ++__from;
++ ++__ret;
++ --__max;
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+new file mode 100644
+index 0000000..c2664a7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -0,0 +1,80 @@
++// std::collate implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
++#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
++#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
++#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
++#endif
++
++namespace std
++{
++ // These are basically extensions to char_traits, and perhaps should
++ // be put there instead of here.
++ template<>
++ int
++ collate<char>::_M_compare(const char* __one, const char* __two) const
++ {
++ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++ }
++
++ template<>
++ size_t
++ collate<char>::_M_transform(char* __to, const char* __from,
++ size_t __n) const
++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ int
++ collate<wchar_t>::_M_compare(const wchar_t* __one,
++ const wchar_t* __two) const
++ {
++ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++ }
++
++ template<>
++ size_t
++ collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
++ size_t __n) const
++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+new file mode 100644
+index 0000000..7294e3a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -0,0 +1,300 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __wctype_l(S, L) wctype((S))
++#define __towupper_l(C, L) towupper((C))
++#define __towlower_l(C, L) towlower((C))
++#define __iswctype_l(C, M, L) iswctype((C), (M))
++#endif
++
++namespace std
++{
++ // NB: The other ctype<char> specializations are in src/locale.cc and
++ // various /config/os/* files.
++ template<>
++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++ : ctype<char>(0, false, __refs)
++ {
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
++ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
++ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
++#endif
++ }
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ ctype<wchar_t>::__wmask_type
++ ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
++ {
++ __wmask_type __ret;
++ switch (__m)
++ {
++ case space:
++ __ret = __wctype_l("space", _M_c_locale_ctype);
++ break;
++ case print:
++ __ret = __wctype_l("print", _M_c_locale_ctype);
++ break;
++ case cntrl:
++ __ret = __wctype_l("cntrl", _M_c_locale_ctype);
++ break;
++ case upper:
++ __ret = __wctype_l("upper", _M_c_locale_ctype);
++ break;
++ case lower:
++ __ret = __wctype_l("lower", _M_c_locale_ctype);
++ break;
++ case alpha:
++ __ret = __wctype_l("alpha", _M_c_locale_ctype);
++ break;
++ case digit:
++ __ret = __wctype_l("digit", _M_c_locale_ctype);
++ break;
++ case punct:
++ __ret = __wctype_l("punct", _M_c_locale_ctype);
++ break;
++ case xdigit:
++ __ret = __wctype_l("xdigit", _M_c_locale_ctype);
++ break;
++ case alnum:
++ __ret = __wctype_l("alnum", _M_c_locale_ctype);
++ break;
++ case graph:
++ __ret = __wctype_l("graph", _M_c_locale_ctype);
++ break;
++ default:
++ __ret = __wmask_type();
++ }
++ return __ret;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_toupper(wchar_t __c) const
++ { return __towupper_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_tolower(wchar_t __c) const
++ { return __towlower_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ bool
++ ctype<wchar_t>::
++ do_is(mask __m, wchar_t __c) const
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ bool __ret = false;
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur]
++ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ return __ret;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
++ {
++ for (; __lo < __hi; ++__vec, ++__lo)
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ const size_t __bitmasksize = 11;
++ mask __m = 0;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
++ __m |= _M_bit[__bitcur];
++ *__vec = __m;
++ }
++ return __hi;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi && !this->do_is(__m, *__lo))
++ ++__lo;
++ return __lo;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
++ {
++ while (__lo < __hi && this->do_is(__m, *__lo) != 0)
++ ++__lo;
++ return __lo;
++ }
++
++ wchar_t
++ ctype<wchar_t>::
++ do_widen(char __c) const
++ { return _M_widen[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<wchar_t>::
++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++ {
++ while (__lo < __hi)
++ {
++ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++ ++__lo;
++ ++__dest;
++ }
++ return __hi;
++ }
++
++ char
++ ctype<wchar_t>::
++ do_narrow(wchar_t __wc, char __dfault) const
++ {
++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
++ return _M_narrow[__wc];
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ const int __c = wctob(__wc);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
++ char* __dest) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ if (_M_narrow_ok)
++ while (__lo < __hi)
++ {
++ if (*__lo >= 0 && *__lo < 128)
++ *__dest = _M_narrow[*__lo];
++ else
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++ ++__lo;
++ ++__dest;
++ }
++ else
++ while (__lo < __hi)
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ ++__lo;
++ ++__dest;
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __hi;
++ }
++
++ void
++ ctype<wchar_t>::_M_initialize_ctype()
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ wint_t __i;
++ for (__i = 0; __i < 128; ++__i)
++ {
++ const int __c = wctob(__i);
++ if (__c == EOF)
++ break;
++ else
++ _M_narrow[__i] = static_cast<char>(__c);
++ }
++ if (__i == 128)
++ _M_narrow_ok = true;
++ else
++ _M_narrow_ok = false;
++ for (size_t __j = 0;
++ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
++ _M_widen[__j] = btowc(__j);
++
++ for (size_t __k = 0; __k <= 11; ++__k)
++ {
++ _M_bit[__k] = static_cast<mask>(_ISbit(__k));
++ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ }
++#endif // _GLIBCXX_USE_WCHAR_T
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+new file mode 100644
+index 0000000..13594d9
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -0,0 +1,100 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix gettext stuff
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__dcgettext(const char *domainname,
++ const char *msgid, int category);
++#undef gettext
++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#else
++#undef gettext
++#define gettext(msgid) (msgid)
++#endif
++
++namespace std
++{
++ // Specializations.
++ template<>
++ string
++ messages<char>::do_get(catalog, int, int, const string& __dfault) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_messages);
++ const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
++ __uselocale(__old);
++ return string(__msg);
++#elif defined __UCLIBC_HAS_LOCALE__
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_messages);
++ const char* __msg = gettext(__dfault.c_str());
++ setlocale(LC_ALL, __old);
++ free(__old);
++ return string(__msg);
++#else
++ const char* __msg = gettext(__dfault.c_str());
++ return string(__msg);
++#endif
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ wstring
++ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
++ {
++# ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_messages);
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ __uselocale(__old);
++ return _M_convert_from_char(__msg);
++# elif defined __UCLIBC_HAS_LOCALE__
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_messages);
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ setlocale(LC_ALL, __old);
++ free(__old);
++ return _M_convert_from_char(__msg);
++# else
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ return _M_convert_from_char(__msg);
++# endif
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+new file mode 100644
+index 0000000..1424078
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -0,0 +1,118 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix prototypes for *textdomain funcs
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__textdomain(const char *domainname);
++extern "C" char *__bindtextdomain(const char *domainname,
++ const char *dirname);
++#else
++#undef __textdomain
++#undef __bindtextdomain
++#define __textdomain(D) ((void)0)
++#define __bindtextdomain(D,P) ((void)0)
++#endif
++
++ // Non-virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::messages(size_t __refs)
++ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
++ _M_name_messages(_S_get_c_name())
++ { }
++
++ template<typename _CharT>
++ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
++ size_t __refs)
++ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
++ _M_name_messages(__s)
++ {
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ _M_name_messages = __tmp;
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
++ const char* __dir) const
++ {
++ __bindtextdomain(__s.c_str(), __dir);
++ return this->do_open(__s, __loc);
++ }
++
++ // Virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::~messages()
++ {
++ if (_M_name_messages != _S_get_c_name())
++ delete [] _M_name_messages;
++ _S_destroy_c_locale(_M_c_locale_messages);
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::do_open(const basic_string<char>& __s,
++ const locale&) const
++ {
++ // No error checking is done, assume the catalog exists and can
++ // be used.
++ __textdomain(__s.c_str());
++ return 0;
++ }
++
++ template<typename _CharT>
++ void
++ messages<_CharT>::do_close(catalog) const
++ { }
++
++ // messages_byname
++ template<typename _CharT>
++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
++ : messages<_CharT>(__refs)
++ {
++ if (this->_M_name_messages != locale::facet::_S_get_c_name())
++ delete [] this->_M_name_messages;
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ this->_M_name_messages = __tmp;
++
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ this->_S_destroy_c_locale(this->_M_c_locale_messages);
++ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
++ }
++ }
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+new file mode 100644
+index 0000000..aa52731
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -0,0 +1,692 @@
++// std::moneypunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning optimize this for uclibc
++#warning tailor for stub locale support
++#endif
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ // Construct and return valid pattern consisting of some combination of:
++ // space none symbol sign value
++ money_base::pattern
++ money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
++ {
++ pattern __ret;
++
++ // This insanely complicated routine attempts to construct a valid
++ // pattern for use with monyepunct. A couple of invariants:
++
++ // if (__precedes) symbol -> value
++ // else value -> symbol
++
++ // if (__space) space
++ // else none
++
++ // none == never first
++ // space never first or last
++
++ // Any elegant implementations of this are welcome.
++ switch (__posn)
++ {
++ case 0:
++ case 1:
++ // 1 The sign precedes the value and symbol.
++ __ret.field[0] = sign;
++ if (__space)
++ {
++ // Pattern starts with sign.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[3] = symbol;
++ }
++ __ret.field[2] = space;
++ }
++ else
++ {
++ // Pattern starts with sign and ends with none.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[3] = none;
++ }
++ break;
++ case 2:
++ // 2 The sign follows the value and symbol.
++ if (__space)
++ {
++ // Pattern either ends with sign.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[1] = space;
++ __ret.field[3] = sign;
++ }
++ else
++ {
++ // Pattern ends with sign then none.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = symbol;
++ }
++ __ret.field[2] = sign;
++ __ret.field[3] = none;
++ }
++ break;
++ case 3:
++ // 3 The sign immediately precedes the symbol.
++ if (__precedes)
++ {
++ __ret.field[0] = sign;
++ __ret.field[1] = symbol;
++ if (__space)
++ {
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[2] = value;
++ __ret.field[3] = none;
++ }
++ }
++ else
++ {
++ __ret.field[0] = value;
++ if (__space)
++ {
++ __ret.field[1] = space;
++ __ret.field[2] = sign;
++ __ret.field[3] = symbol;
++ }
++ else
++ {
++ __ret.field[1] = sign;
++ __ret.field[2] = symbol;
++ __ret.field[3] = none;
++ }
++ }
++ break;
++ case 4:
++ // 4 The sign immediately follows the symbol.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = sign;
++ if (__space)
++ {
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[2] = value;
++ __ret.field[3] = none;
++ }
++ }
++ else
++ {
++ __ret.field[0] = value;
++ if (__space)
++ {
++ __ret.field[1] = space;
++ __ret.field[2] = symbol;
++ __ret.field[3] = sign;
++ }
++ else
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = sign;
++ __ret.field[3] = none;
++ }
++ }
++ break;
++ default:
++ ;
++ }
++ return __ret;
++ }
++
++ template<>
++ void
++ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, true>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = "";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = "";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = "";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++ __cloc));
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_data->_M_negative_sign = "()";
++ else
++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++ __cloc);
++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++ // _Intl == true
++ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++ __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++ }
++ }
++
++ template<>
++ void
++ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, false>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = "";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = "";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = "";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++ __cloc));
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_data->_M_negative_sign = "()";
++ else
++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++ __cloc);
++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++ // _Intl == false
++ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++ }
++ }
++
++ template<>
++ moneypunct<char, true>::~moneypunct()
++ { delete _M_data; }
++
++ template<>
++ moneypunct<char, false>::~moneypunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<wchar_t, true>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++ __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ void
++ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<wchar_t, false>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len;
++ __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ moneypunct<wchar_t, true>::~moneypunct()
++ {
++ if (_M_data->_M_positive_sign_size)
++ delete [] _M_data->_M_positive_sign;
++ if (_M_data->_M_negative_sign_size
++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++ delete [] _M_data->_M_negative_sign;
++ if (_M_data->_M_curr_symbol_size)
++ delete [] _M_data->_M_curr_symbol;
++ delete _M_data;
++ }
++
++ template<>
++ moneypunct<wchar_t, false>::~moneypunct()
++ {
++ if (_M_data->_M_positive_sign_size)
++ delete [] _M_data->_M_positive_sign;
++ if (_M_data->_M_negative_sign_size
++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++ delete [] _M_data->_M_negative_sign;
++ if (_M_data->_M_curr_symbol_size)
++ delete [] _M_data->_M_curr_symbol;
++ delete _M_data;
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+new file mode 100644
+index 0000000..883ec1a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -0,0 +1,160 @@
++// std::numpunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<char>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_use_grouping = false;
++
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
++ __cloc));
++
++ // Check for NULL, which implies no grouping.
++ if (_M_data->_M_thousands_sep == '\0')
++ _M_data->_M_grouping = "";
++ else
++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ }
++
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_data->_M_truename = "true";
++ _M_data->_M_truename_size = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = "false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ template<>
++ numpunct<char>::~numpunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<wchar_t>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_use_grouping = false;
++
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ _M_data->_M_atoms_out[__i] =
++ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ _M_data->_M_atoms_in[__j] =
++ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
++ }
++ else
++ {
++ // Named locale.
++ // NB: In the GNU model wchar_t is always 32 bit wide.
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++
++ if (_M_data->_M_thousands_sep == L'\0')
++ _M_data->_M_grouping = "";
++ else
++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ }
++
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_data->_M_truename = L"true";
++ _M_data->_M_truename_size = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = L"false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ template<>
++ numpunct<wchar_t>::~numpunct()
++ { delete _M_data; }
++ #endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+new file mode 100644
+index 0000000..e0707d7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -0,0 +1,406 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __timepunct<char>::
++ _M_put(char* __s, size_t __maxlen, const char* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = strftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = '\0';
++ }
++
++ template<>
++ void
++ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<char>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_get_c_locale();
++
++ _M_data->_M_date_format = "%m/%d/%y";
++ _M_data->_M_date_era_format = "%m/%d/%y";
++ _M_data->_M_time_format = "%H:%M:%S";
++ _M_data->_M_time_era_format = "%H:%M:%S";
++ _M_data->_M_date_time_format = "";
++ _M_data->_M_date_time_era_format = "";
++ _M_data->_M_am = "AM";
++ _M_data->_M_pm = "PM";
++ _M_data->_M_am_pm_format = "";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = "Sunday";
++ _M_data->_M_day2 = "Monday";
++ _M_data->_M_day3 = "Tuesday";
++ _M_data->_M_day4 = "Wednesday";
++ _M_data->_M_day5 = "Thursday";
++ _M_data->_M_day6 = "Friday";
++ _M_data->_M_day7 = "Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = "Sun";
++ _M_data->_M_aday2 = "Mon";
++ _M_data->_M_aday3 = "Tue";
++ _M_data->_M_aday4 = "Wed";
++ _M_data->_M_aday5 = "Thu";
++ _M_data->_M_aday6 = "Fri";
++ _M_data->_M_aday7 = "Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = "January";
++ _M_data->_M_month02 = "February";
++ _M_data->_M_month03 = "March";
++ _M_data->_M_month04 = "April";
++ _M_data->_M_month05 = "May";
++ _M_data->_M_month06 = "June";
++ _M_data->_M_month07 = "July";
++ _M_data->_M_month08 = "August";
++ _M_data->_M_month09 = "September";
++ _M_data->_M_month10 = "October";
++ _M_data->_M_month11 = "November";
++ _M_data->_M_month12 = "December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = "Jan";
++ _M_data->_M_amonth02 = "Feb";
++ _M_data->_M_amonth03 = "Mar";
++ _M_data->_M_amonth04 = "Apr";
++ _M_data->_M_amonth05 = "May";
++ _M_data->_M_amonth06 = "Jun";
++ _M_data->_M_amonth07 = "Jul";
++ _M_data->_M_amonth08 = "Aug";
++ _M_data->_M_amonth09 = "Sep";
++ _M_data->_M_amonth10 = "Oct";
++ _M_data->_M_amonth11 = "Nov";
++ _M_data->_M_amonth12 = "Dec";
++ }
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
++ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
++ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
++ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
++ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
++ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
++ __cloc);
++ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
++ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
++ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
++ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
++ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
++ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
++ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
++ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
++ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
++ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
++ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
++ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
++ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
++ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
++ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
++ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
++ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
++ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
++ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
++ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
++ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
++ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
++ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
++ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
++ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
++ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
++ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
++ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
++ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
++ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
++ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
++ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
++ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
++ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
++ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
++ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
++ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
++ }
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ __timepunct<wchar_t>::
++ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
++ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = L'\0';
++ }
++
++ template<>
++ void
++ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<wchar_t>;
++
++#warning wide time stuff
++// if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_get_c_locale();
++
++ _M_data->_M_date_format = L"%m/%d/%y";
++ _M_data->_M_date_era_format = L"%m/%d/%y";
++ _M_data->_M_time_format = L"%H:%M:%S";
++ _M_data->_M_time_era_format = L"%H:%M:%S";
++ _M_data->_M_date_time_format = L"";
++ _M_data->_M_date_time_era_format = L"";
++ _M_data->_M_am = L"AM";
++ _M_data->_M_pm = L"PM";
++ _M_data->_M_am_pm_format = L"";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = L"Sunday";
++ _M_data->_M_day2 = L"Monday";
++ _M_data->_M_day3 = L"Tuesday";
++ _M_data->_M_day4 = L"Wednesday";
++ _M_data->_M_day5 = L"Thursday";
++ _M_data->_M_day6 = L"Friday";
++ _M_data->_M_day7 = L"Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = L"Sun";
++ _M_data->_M_aday2 = L"Mon";
++ _M_data->_M_aday3 = L"Tue";
++ _M_data->_M_aday4 = L"Wed";
++ _M_data->_M_aday5 = L"Thu";
++ _M_data->_M_aday6 = L"Fri";
++ _M_data->_M_aday7 = L"Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = L"January";
++ _M_data->_M_month02 = L"February";
++ _M_data->_M_month03 = L"March";
++ _M_data->_M_month04 = L"April";
++ _M_data->_M_month05 = L"May";
++ _M_data->_M_month06 = L"June";
++ _M_data->_M_month07 = L"July";
++ _M_data->_M_month08 = L"August";
++ _M_data->_M_month09 = L"September";
++ _M_data->_M_month10 = L"October";
++ _M_data->_M_month11 = L"November";
++ _M_data->_M_month12 = L"December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = L"Jan";
++ _M_data->_M_amonth02 = L"Feb";
++ _M_data->_M_amonth03 = L"Mar";
++ _M_data->_M_amonth04 = L"Apr";
++ _M_data->_M_amonth05 = L"May";
++ _M_data->_M_amonth06 = L"Jun";
++ _M_data->_M_amonth07 = L"Jul";
++ _M_data->_M_amonth08 = L"Aug";
++ _M_data->_M_amonth09 = L"Sep";
++ _M_data->_M_amonth10 = L"Oct";
++ _M_data->_M_amonth11 = L"Nov";
++ _M_data->_M_amonth12 = L"Dec";
++ }
++#if 0
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ union { char *__s; wchar_t *__w; } __u;
++
++ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
++ _M_data->_M_date_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
++ _M_data->_M_date_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
++ _M_data->_M_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
++ _M_data->_M_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
++ _M_data->_M_date_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
++ _M_data->_M_date_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
++ _M_data->_M_am = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
++ _M_data->_M_pm = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
++ _M_data->_M_am_pm_format = __u.__w;
++
++ // Day names, starting with "C"'s Sunday.
++ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
++ _M_data->_M_day1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
++ _M_data->_M_day2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
++ _M_data->_M_day3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
++ _M_data->_M_day4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
++ _M_data->_M_day5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
++ _M_data->_M_day6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
++ _M_data->_M_day7 = __u.__w;
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
++ _M_data->_M_aday1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
++ _M_data->_M_aday2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
++ _M_data->_M_aday3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
++ _M_data->_M_aday4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
++ _M_data->_M_aday5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
++ _M_data->_M_aday6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
++ _M_data->_M_aday7 = __u.__w;
++
++ // Month names, starting with "C"'s January.
++ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
++ _M_data->_M_month01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
++ _M_data->_M_month02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
++ _M_data->_M_month03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
++ _M_data->_M_month04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
++ _M_data->_M_month05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
++ _M_data->_M_month06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
++ _M_data->_M_month07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
++ _M_data->_M_month08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
++ _M_data->_M_month09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
++ _M_data->_M_month10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
++ _M_data->_M_month11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
++ _M_data->_M_month12 = __u.__w;
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
++ _M_data->_M_amonth01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
++ _M_data->_M_amonth02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
++ _M_data->_M_amonth03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
++ _M_data->_M_amonth04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
++ _M_data->_M_amonth05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
++ _M_data->_M_amonth06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
++ _M_data->_M_amonth07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
++ _M_data->_M_amonth08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
++ _M_data->_M_amonth09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
++ _M_data->_M_amonth10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
++ _M_data->_M_amonth11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
++ _M_data->_M_amonth12 = __u.__w;
++ }
++#endif // 0
++ }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+new file mode 100644
+index 0000000..ba8e858
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -0,0 +1,68 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(size_t __refs)
++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(_S_get_c_name())
++ { _M_initialize_timepunct(); }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
++ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(_S_get_c_name())
++ { _M_initialize_timepunct(); }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
++ size_t __refs)
++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(__s)
++ {
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ _M_name_timepunct = __tmp;
++ _M_initialize_timepunct(__cloc);
++ }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::~__timepunct()
++ {
++ if (_M_name_timepunct != _S_get_c_name())
++ delete [] _M_name_timepunct;
++ delete _M_data;
++ _S_destroy_c_locale(_M_c_locale_timepunct);
++ }
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index 8cd4c76..217012e 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -15918,6 +15918,9 @@ fi
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ *-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ enable_clocale_flag=gnu
+ ;;
+@@ -16196,6 +16199,78 @@ $as_echo "newlib" >&6; }
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: uclibc" >&5
++$as_echo "uclibc" >&6; }
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ # Extract the first word of "msgfmt", so it can be a program name with args.
++set dummy msgfmt; 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_check_msgfmt+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$check_msgfmt"; then
++ ac_cv_prog_check_msgfmt="$check_msgfmt" # 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_check_msgfmt="yes"
++ $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
++
++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
++fi
++fi
++check_msgfmt=$ac_cv_prog_check_msgfmt
++if test -n "$check_msgfmt"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_msgfmt" >&5
++$as_echo "$check_msgfmt" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++
++
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/include/c_compatibility/wchar.h b/libstdc++-v3/include/c_compatibility/wchar.h
+index 06b5d47..7d3f835 100644
+--- a/libstdc++-v3/include/c_compatibility/wchar.h
++++ b/libstdc++-v3/include/c_compatibility/wchar.h
+@@ -101,7 +101,9 @@ using std::wmemcmp;
+ using std::wmemcpy;
+ using std::wmemmove;
+ using std::wmemset;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using std::wcsftime;
++#endif
+
+ #if _GLIBCXX_USE_C99
+ using std::wcstold;
+diff --git a/libstdc++-v3/include/c_std/cwchar b/libstdc++-v3/include/c_std/cwchar
+index aa1b2fa..45c4617 100644
+--- a/libstdc++-v3/include/c_std/cwchar
++++ b/libstdc++-v3/include/c_std/cwchar
+@@ -175,7 +175,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using ::wcsftime;
++#endif
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0005-uclibc-locale-no__x.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0005-uclibc-locale-no__x.patch
new file mode 100644
index 000000000..19a86a4e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0005-uclibc-locale-no__x.patch
@@ -0,0 +1,257 @@
+From 72a1a4af3c18627f59aa5ba1f753a89011b4e4f0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:42:36 +0400
+Subject: [PATCH 05/46] uclibc-locale-no__x
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h | 45 ++++++++++++++++++++++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc | 14 -------
+ libstdc++-v3/config/locale/uclibc/c_locale.h | 1 +
+ .../config/locale/uclibc/collate_members.cc | 7 ----
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 7 ----
+ .../config/locale/uclibc/messages_members.cc | 7 +---
+ .../config/locale/uclibc/messages_members.h | 18 ++++-----
+ .../config/locale/uclibc/monetary_members.cc | 4 --
+ .../config/locale/uclibc/numeric_members.cc | 3 --
+ libstdc++-v3/config/locale/uclibc/time_members.cc | 3 --
+ 10 files changed, 55 insertions(+), 54 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index 2ae3e4a..e74fddf 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -60,4 +60,49 @@ extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
+ extern "C" __typeof(wctype_l) __wctype_l;
+ #endif
+
++# define __nl_langinfo_l nl_langinfo_l
++# define __strcoll_l strcoll_l
++# define __strftime_l strftime_l
++# define __strtod_l strtod_l
++# define __strtof_l strtof_l
++# define __strtold_l strtold_l
++# define __strxfrm_l strxfrm_l
++# define __newlocale newlocale
++# define __freelocale freelocale
++# define __duplocale duplocale
++# define __uselocale uselocale
++
++# ifdef _GLIBCXX_USE_WCHAR_T
++# define __iswctype_l iswctype_l
++# define __towlower_l towlower_l
++# define __towupper_l towupper_l
++# define __wcscoll_l wcscoll_l
++# define __wcsftime_l wcsftime_l
++# define __wcsxfrm_l wcsxfrm_l
++# define __wctype_l wctype_l
++# endif
++
++#else
++# define __nl_langinfo_l(N, L) nl_langinfo((N))
++# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
++# define __strtod_l(S, E, L) strtod((S), (E))
++# define __strtof_l(S, E, L) strtof((S), (E))
++# define __strtold_l(S, E, L) strtold((S), (E))
++# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
++# warning should dummy __newlocale check for C|POSIX ?
++# define __newlocale(a, b, c) NULL
++# define __freelocale(a) ((void)0)
++# define __duplocale(a) __c_locale()
++//# define __uselocale ?
++//
++# ifdef _GLIBCXX_USE_WCHAR_T
++# define __iswctype_l(C, M, L) iswctype((C), (M))
++# define __towlower_l(C, L) towlower((C))
++# define __towupper_l(C, L) towupper((C))
++# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
++//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
++# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
++# define __wctype_l(S, L) wctype((S))
++# endif
++
+ #endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 5081dc1..21430d0 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,20 +39,6 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
+-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
+-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
+-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
+-#define __strtof_l(S, E, L) strtof((S), (E))
+-#define __strtod_l(S, E, L) strtod((S), (E))
+-#define __strtold_l(S, E, L) strtold((S), (E))
+-#warning should dummy __newlocale check for C|POSIX ?
+-#define __newlocale(a, b, c) NULL
+-#define __freelocale(a) ((void)0)
+-#define __duplocale(a) __c_locale()
+-#endif
+-
+ namespace std
+ {
+ template<>
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index da07c1f..4bca5f1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -68,6 +68,7 @@ namespace __gnu_cxx
+ {
+ extern "C" __typeof(uselocale) __uselocale;
+ }
++#define __uselocale uselocale
+ #endif
+
+ namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+index c2664a7..ec5c329 100644
+--- a/libstdc++-v3/config/locale/uclibc/collate_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -36,13 +36,6 @@
+ #include <locale>
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
+-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
+-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
+-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
+-#endif
+-
+ namespace std
+ {
+ // These are basically extensions to char_traits, and perhaps should
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7294e3a..7b12861 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -38,13 +38,6 @@
+ #undef _LIBC
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __wctype_l(S, L) wctype((S))
+-#define __towupper_l(C, L) towupper((C))
+-#define __towlower_l(C, L) towlower((C))
+-#define __iswctype_l(C, M, L) iswctype((C), (M))
+-#endif
+-
+ namespace std
+ {
+ // NB: The other ctype<char> specializations are in src/locale.cc and
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+index 13594d9..d7693b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -39,13 +39,10 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix gettext stuff
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__dcgettext(const char *domainname,
+- const char *msgid, int category);
+ #undef gettext
+-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
+ #else
+-#undef gettext
+ #define gettext(msgid) (msgid)
+ #endif
+
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index 1424078..d89da33 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -36,15 +36,11 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix prototypes for *textdomain funcs
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__textdomain(const char *domainname);
+-extern "C" char *__bindtextdomain(const char *domainname,
+- const char *dirname);
+-#else
+-#undef __textdomain
+-#undef __bindtextdomain
+-#define __textdomain(D) ((void)0)
+-#define __bindtextdomain(D,P) ((void)0)
++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#undef textdomain
++#undef bindtextdomain
++#define textdomain(D) ((void)0)
++#define bindtextdomain(D,P) ((void)0)
+ #endif
+
+ // Non-virtual member functions.
+@@ -70,7 +66,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
+ const char* __dir) const
+ {
+- __bindtextdomain(__s.c_str(), __dir);
++ bindtextdomain(__s.c_str(), __dir);
+ return this->do_open(__s, __loc);
+ }
+
+@@ -90,7 +86,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+ {
+ // No error checking is done, assume the catalog exists and can
+ // be used.
+- __textdomain(__s.c_str());
++ textdomain(__s.c_str());
+ return 0;
+ }
+
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index aa52731..2e6f80a 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -43,10 +43,6 @@
+ #warning tailor for stub locale support
+ #endif
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+-
+ namespace std
+ {
+ // Construct and return valid pattern consisting of some combination of:
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 883ec1a..2c70642 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -41,9 +41,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+
+ namespace std
+ {
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index e0707d7..d848ed5 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -40,9 +40,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+
+ namespace std
+ {
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0006-uclibc-locale-wchar_fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0006-uclibc-locale-wchar_fix.patch
new file mode 100644
index 000000000..d7dbe68bd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0006-uclibc-locale-wchar_fix.patch
@@ -0,0 +1,68 @@
+From b1298344f0c221c382a95af689f7f3ecd864f531 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:45:57 +0400
+Subject: [PATCH 06/46] uclibc-locale-wchar_fix
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/uclibc/monetary_members.cc | 4 ++--
+ libstdc++-v3/config/locale/uclibc/numeric_members.cc | 13 +++++++++++++
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 2e6f80a..31ebb9f 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -401,7 +401,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+@@ -556,7 +556,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 2c70642..d5c8961 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -127,12 +127,25 @@ namespace std
+ {
+ // Named locale.
+ // NB: In the GNU model wchar_t is always 32 bit wide.
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be numeric
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
+ union { char *__s; wchar_t __w; } __u;
+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
+ _M_data->_M_decimal_point = __u.__w;
+
+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
+ _M_data->_M_thousands_sep = __u.__w;
++#endif
+
+ if (_M_data->_M_thousands_sep == L'\0')
+ _M_data->_M_grouping = "";
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0007-uclibc-locale-update.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0007-uclibc-locale-update.patch
new file mode 100644
index 000000000..cde749931
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0007-uclibc-locale-update.patch
@@ -0,0 +1,542 @@
+From e9d7cb62741c22d667fe56e98d50753d89aefdc3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:46:58 +0400
+Subject: [PATCH 07/46] uclibc-locale-update
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h | 3 +
+ libstdc++-v3/config/locale/uclibc/c_locale.cc | 74 ++++++++++------------
+ libstdc++-v3/config/locale/uclibc/c_locale.h | 42 ++++++------
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 51 +++++++++++----
+ .../config/locale/uclibc/messages_members.h | 12 ++--
+ .../config/locale/uclibc/monetary_members.cc | 34 ++++++----
+ .../config/locale/uclibc/numeric_members.cc | 5 ++
+ libstdc++-v3/config/locale/uclibc/time_members.cc | 18 ++++--
+ libstdc++-v3/config/locale/uclibc/time_members.h | 17 +++--
+ 9 files changed, 158 insertions(+), 98 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index e74fddf..971a6b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -31,6 +31,9 @@
+
+ #include <bits/c++config.h>
+ #include <clocale>
++#include <cstdlib>
++#include <cstring>
++#include <cstddef>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning clean this up
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 21430d0..1b9d8e1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,23 +39,20 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+ template<>
+ void
+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- float __f = __strtof_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __f;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __f;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ template<>
+@@ -63,16 +60,13 @@ namespace std
+ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- double __d = __strtod_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __d;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __d;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ template<>
+@@ -80,16 +74,13 @@ namespace std
+ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- long double __ld = __strtold_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __ld;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __ld;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ void
+@@ -110,17 +101,18 @@ namespace std
+ void
+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
+ {
+- if (_S_get_c_locale() != __cloc)
++ if (__cloc && _S_get_c_locale() != __cloc)
+ __freelocale(__cloc);
+ }
+
+ __c_locale
+ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
+ { return __duplocale(__cloc); }
+-} // namespace std
+
+-namespace __gnu_cxx
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
++
+ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
+ {
+ "LC_CTYPE",
+@@ -138,9 +130,11 @@ namespace __gnu_cxx
+ "LC_IDENTIFICATION"
+ #endif
+ };
+-}
+
+-namespace std
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
+-} // namespace std
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index 4bca5f1..64a6d46 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -39,21 +39,23 @@
+ #pragma GCC system_header
+
+ #include <cstring> // get std::strlen
+-#include <cstdio> // get std::snprintf or std::sprintf
++#include <cstdio> // get std::vsnprintf or std::vsprintf
+ #include <clocale>
+ #include <langinfo.h> // For codecvt
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix this
+ #endif
+-#ifdef __UCLIBC_HAS_LOCALE__
++#ifdef _GLIBCXX_USE_ICONV
+ #include <iconv.h> // For codecvt using iconv, iconv_t
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-#include <libintl.h> // For messages
++#ifdef HAVE_LIBINTL_H
++#include <libintl.h> // For messages
+ #endif
++#include <cstdarg>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning what is _GLIBCXX_C_LOCALE_GNU for
++// psm: used in os/gnu-linux/ctype_noninline.h
+ #endif
+ #define _GLIBCXX_C_LOCALE_GNU 1
+
+@@ -78,23 +80,25 @@ namespace std
+ #else
+ typedef int* __c_locale;
+ #endif
+-
+- // Convert numeric value of type _Tv to string and return length of
+- // string. If snprintf is available use it, otherwise fall back to
+- // the unsafe sprintf which, in general, can be dangerous and should
++ // Convert numeric value of type double to string and return length of
++ // string. If vsnprintf is available use it, otherwise fall back to
++ // the unsafe vsprintf which, in general, can be dangerous and should
+ // be avoided.
+- template<typename _Tv>
+- int
+- __convert_from_v(char* __out,
+- const int __size __attribute__ ((__unused__)),
+- const char* __fmt,
+-#ifdef __UCLIBC_HAS_XCLOCALE__
+- _Tv __v, const __c_locale& __cloc, int __prec)
++ inline int
++ __convert_from_v(const __c_locale&
++#ifndef __UCLIBC_HAS_XCLOCALE__
++ __cloc __attribute__ ((__unused__))
++#endif
++ ,
++ char* __out,
++ const int __size,
++ const char* __fmt, ...)
+ {
++ va_list __args;
++#ifdef __UCLIBC_HAS_XCLOCALE__
++
+ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
+ #else
+- _Tv __v, const __c_locale&, int __prec)
+- {
+ # ifdef __UCLIBC_HAS_LOCALE__
+ char* __old = std::setlocale(LC_ALL, NULL);
+ char* __sav = new char[std::strlen(__old) + 1];
+@@ -103,7 +107,9 @@ namespace std
+ # endif
+ #endif
+
+- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++ va_start(__args, __fmt);
++ const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
++ va_end(__args);
+
+ #ifdef __UCLIBC_HAS_XCLOCALE__
+ __gnu_cxx::__uselocale(__old);
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7b12861..13e011d 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -33,16 +33,20 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+ // NB: The other ctype<char> specializations are in src/locale.cc and
+ // various /config/os/* files.
+- template<>
+ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
+ : ctype<char>(0, false, __refs)
+ {
+@@ -57,6 +61,8 @@ namespace std
+ #endif
+ }
+ }
++ ctype_byname<char>::~ctype_byname()
++ { }
+
+ #ifdef _GLIBCXX_USE_WCHAR_T
+ ctype<wchar_t>::__wmask_type
+@@ -138,17 +144,33 @@ namespace std
+ ctype<wchar_t>::
+ do_is(mask __m, wchar_t __c) const
+ {
+- // Highest bitmask in ctype_base == 10, but extra in "C"
+- // library for blank.
++ // The case of __m == ctype_base::space is particularly important,
++ // due to its use in many istream functions. Therefore we deal with
++ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
++ // is the mask corresponding to ctype_base::space. NB: an encoding
++ // change would not affect correctness!
++
+ bool __ret = false;
+- const size_t __bitmasksize = 11;
+- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
+- if (__m & _M_bit[__bitcur]
+- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
+- {
+- __ret = true;
+- break;
+- }
++ if (__m == _M_bit[5])
++ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
++ else
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur])
++ {
++ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ else if (__m == _M_bit[__bitcur])
++ break;
++ }
++ }
++
+ return __ret;
+ }
+
+@@ -290,4 +312,5 @@ namespace std
+ #endif
+ }
+ #endif // _GLIBCXX_USE_WCHAR_T
+-}
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index d89da33..067657a 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -53,12 +53,16 @@
+ template<typename _CharT>
+ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
+ size_t __refs)
+- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
+- _M_name_messages(__s)
++ : facet(__refs), _M_c_locale_messages(NULL),
++ _M_name_messages(NULL)
+ {
+- char* __tmp = new char[std::strlen(__s) + 1];
+- std::strcpy(__tmp, __s);
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
+ _M_name_messages = __tmp;
++
++ // Last to avoid leaking memory if new throws.
++ _M_c_locale_messages = _S_clone_c_locale(__cloc);
+ }
+
+ template<typename _CharT>
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 31ebb9f..7679b9c 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -33,9 +33,14 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -206,7 +211,7 @@ namespace std
+ }
+ break;
+ default:
+- ;
++ __ret = pattern();
+ }
+ return __ret;
+ }
+@@ -390,7 +395,9 @@ namespace std
+ __c_locale __old = __uselocale(__cloc);
+ #else
+ // Switch to named locale so that mbsrtowcs will work.
+- char* __old = strdup(setlocale(LC_ALL, NULL));
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
+ setlocale(LC_ALL, __name);
+ #endif
+
+@@ -477,8 +484,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ __throw_exception_again;
+ }
+@@ -498,8 +505,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ }
+ }
+@@ -545,8 +552,11 @@ namespace std
+ __c_locale __old = __uselocale(__cloc);
+ #else
+ // Switch to named locale so that mbsrtowcs will work.
+- char* __old = strdup(setlocale(LC_ALL, NULL));
+- setlocale(LC_ALL, __name);
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
++ memcpy(__sav, __old, __llen);
++ setlocale(LC_ALL, __name);
+ #endif
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -633,8 +643,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ __throw_exception_again;
+ }
+@@ -653,8 +663,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ __uselocale(__old);
+ #else
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ }
+ }
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index d5c8961..8ae8969 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -33,9 +33,14 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index d848ed5..f24d53e 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -53,11 +53,14 @@ namespace std
+ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
+ _M_c_locale_timepunct);
+ #else
+- char* __old = strdup(setlocale(LC_ALL, NULL));
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
++ memcpy(__sav, __old, __llen);
+ setlocale(LC_ALL, _M_name_timepunct);
+ const size_t __len = strftime(__s, __maxlen, __format, __tm);
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ // Make sure __s is null terminated.
+ if (__len == 0)
+@@ -207,11 +210,14 @@ namespace std
+ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
+ _M_c_locale_timepunct);
+ #else
+- char* __old = strdup(setlocale(LC_ALL, NULL));
++ char* __old = setlocale(LC_ALL, NULL);
++ const size_t __llen = strlen(__old) + 1;
++ char* __sav = new char[__llen];
++ memcpy(__sav, __old, __llen);
+ setlocale(LC_ALL, _M_name_timepunct);
+ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
+- setlocale(LC_ALL, __old);
+- free(__old);
++ setlocale(LC_ALL, __sav);
++ delete [] __sav;
+ #endif
+ // Make sure __s is null terminated.
+ if (__len == 0)
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+index ba8e858..1665dde 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.h
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -50,12 +50,21 @@
+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
+ size_t __refs)
+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+- _M_name_timepunct(__s)
++ _M_name_timepunct(NULL)
+ {
+- char* __tmp = new char[std::strlen(__s) + 1];
+- std::strcpy(__tmp, __s);
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
+ _M_name_timepunct = __tmp;
+- _M_initialize_timepunct(__cloc);
++
++ try
++ { _M_initialize_timepunct(__cloc); }
++ catch(...)
++ {
++ delete [] _M_name_timepunct;
++ __throw_exception_again;
++ }
++
+ }
+
+ template<typename _CharT>
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0008-missing-execinfo_h.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0008-missing-execinfo_h.patch
new file mode 100644
index 000000000..9f8793125
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0008-missing-execinfo_h.patch
@@ -0,0 +1,28 @@
+From 9b7442069eb68a42d2437181c1b2e710dd077e8b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:48:10 +0400
+Subject: [PATCH 08/46] missing-execinfo_h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ boehm-gc/include/gc.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h
+index 6b38f2d..fca98ff 100644
+--- a/boehm-gc/include/gc.h
++++ b/boehm-gc/include/gc.h
+@@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb));
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0009-c99-snprintf.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0009-c99-snprintf.patch
new file mode 100644
index 000000000..6b236c62c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0009-c99-snprintf.patch
@@ -0,0 +1,28 @@
+From fde97f80d2d931ed3fa4a86294799366b2359331 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:49:03 +0400
+Subject: [PATCH 09/46] c99-snprintf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/include/c_std/cstdio | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libstdc++-v3/include/c_std/cstdio b/libstdc++-v3/include/c_std/cstdio
+index 37f01ca..f00c06d 100644
+--- a/libstdc++-v3/include/c_std/cstdio
++++ b/libstdc++-v3/include/c_std/cstdio
+@@ -144,7 +144,7 @@ namespace std
+ using ::vsprintf;
+ } // namespace std
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0010-gcc-poison-system-directories.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0010-gcc-poison-system-directories.patch
new file mode 100644
index 000000000..2da887767
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0010-gcc-poison-system-directories.patch
@@ -0,0 +1,192 @@
+From 7a90e62d557c78ae52006dff30c99006e10d9357 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:59:00 +0400
+Subject: [PATCH 10/46] gcc: poison-system-directories
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [distribution: codesourcery]
+---
+ gcc/common.opt | 4 ++++
+ gcc/config.in | 6 ++++++
+ gcc/configure | 16 ++++++++++++++++
+ gcc/configure.ac | 10 ++++++++++
+ gcc/doc/invoke.texi | 9 +++++++++
+ gcc/gcc.c | 2 ++
+ gcc/incpath.c | 19 +++++++++++++++++++
+ 7 files changed, 66 insertions(+)
+
+diff --git a/gcc/common.opt b/gcc/common.opt
+index 1218a71..bfba114 100644
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -623,6 +623,10 @@ Wreturn-local-addr
+ Common Var(warn_return_local_addr) Init(1) Warning
+ Warn about returning a pointer/reference to a local or temporary variable.
+
++Wpoison-system-directories
++Common Var(flag_poison_system_directories) Init(1) Warning
++Warn for -I and -L options using system directories if cross compiling
++
+ Wshadow
+ Common Var(warn_shadow) Warning
+ Warn when one local variable shadows another
+diff --git a/gcc/config.in b/gcc/config.in
+index 5335258..f079826 100644
+--- a/gcc/config.in
++++ b/gcc/config.in
+@@ -168,6 +168,12 @@
+ #endif
+
+
++/* Define to warn for use of native system header directories */
++#ifndef USED_FOR_TARGET
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++#endif
++
++
+ /* Define if you want all operations on RTL (the basic data structure of the
+ optimizer and back end) to be checked for dynamic type safety at runtime.
+ This is quite expensive. */
+diff --git a/gcc/configure b/gcc/configure
+index 3c92795..34371a3 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -933,6 +933,7 @@ with_system_zlib
+ enable_maintainer_mode
+ enable_link_mutex
+ enable_version_specific_runtime_libs
++enable_poison_system_directories
+ enable_plugin
+ enable_host_shared
+ enable_libquadmath_support
+@@ -1670,6 +1671,8 @@ Optional Features:
+ --enable-version-specific-runtime-libs
+ specify that runtime libraries should be installed
+ in a compiler-specific directory
++ --enable-poison-system-directories
++ warn for use of native system header directories
+ --enable-plugin enable plugin support
+ --enable-host-shared build host code as shared libraries
+ --disable-libquadmath-support
+@@ -28211,6 +28214,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
+ 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
++
+ # Substitute configuration variables
+
+
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index d414081..240d322 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5654,6 +5654,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
+ [specify that runtime libraries should be
+ installed in a compiler-specific directory])])
+
++AC_ARG_ENABLE([poison-system-directories],
++ AS_HELP_STRING([--enable-poison-system-directories],
++ [warn for use of native system header 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 header directories])
++fi
++
+ # Substitute configuration variables
+ AC_SUBST(subdirs)
+ AC_SUBST(srcdir)
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+index d3be589..c81b55b 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -269,6 +269,7 @@ Objective-C and Objective-C++ Dialects}.
+ -Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol
+ -Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
+ -Wpointer-arith -Wno-pointer-to-int-cast @gol
++-Wno-poison-system-directories @gol
+ -Wredundant-decls -Wno-return-local-addr @gol
+ -Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar @gol
+ -Wshift-count-negative -Wshift-count-overflow @gol
+@@ -4433,6 +4434,14 @@ made up of data only and thus requires no special treatment. But, for
+ most targets, it is made up of code and thus requires the stack to be
+ made executable in order for the program to work properly.
+
++@item -Wno-poison-system-directories
++@opindex Wno-poison-system-directories
++Do not warn for @option{-I} or @option{-L} options using system
++directories such as @file{/usr/include} when cross compiling. This
++option is intended for use in chroot environments when such
++directories contain the correct headers and libraries for the target
++system rather than the host.
++
+ @item -Wfloat-equal
+ @opindex Wfloat-equal
+ @opindex Wno-float-equal
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index d956c36..675bcc1 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -835,6 +835,8 @@ proper position among the other output files. */
+ "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
+ "%X %{o*} %{e*} %{N} %{n} %{r}\
+ %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
++ %{Wno-poison-system-directories:--no-poison-system-directories}\
++ %{Werror=poison-system-directories:--error-poison-system-directories}\
+ %{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
+ " CHKP_SPEC " \
+ %{fopenacc|fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
+diff --git a/gcc/incpath.c b/gcc/incpath.c
+index 6c54ca6..cc0c921 100644
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -28,6 +28,7 @@
+ #include "intl.h"
+ #include "incpath.h"
+ #include "cppdefault.h"
++#include "diagnostic-core.h"
+
+ /* Microsoft Windows does not natively support inodes.
+ VMS has non-numeric inodes. */
+@@ -383,6 +384,24 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
+ }
+ fprintf (stderr, _("End of search list.\n"));
+ }
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++ if (flag_poison_system_directories)
++ {
++ struct cpp_dir *p;
++
++ for (p = heads[QUOTE]; p; p = p->next)
++ {
++ if ((!strncmp (p->name, "/usr/include", 12))
++ || (!strncmp (p->name, "/usr/local/include", 18))
++ || (!strncmp (p->name, "/usr/X11R6/include", 18)))
++ warning (OPT_Wpoison_system_directories,
++ "include location \"%s\" is unsafe for "
++ "cross-compilation",
++ p->name);
++ }
++ }
++#endif
+ }
+
+ /* Use given -I paths for #include "..." but not #include <...>, and
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0011-gcc-poison-dir-extend.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0011-gcc-poison-dir-extend.patch
new file mode 100644
index 000000000..511e69481
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0011-gcc-poison-dir-extend.patch
@@ -0,0 +1,39 @@
+From db406054de6b0967cd76cbb998f05b0c5af0bd94 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:00:34 +0400
+Subject: [PATCH 11/46] gcc-poison-dir-extend
+
+Add /sw/include and /opt/include based on the original
+zecke-no-host-includes.patch patch. The original patch checked for
+/usr/include, /sw/include and /opt/include and then triggered a failure and
+aborted.
+
+Instead, we add the two missing items to the current scan. If the user
+wants this to be a failure, they can add "-Werror=poison-system-directories".
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/incpath.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/incpath.c b/gcc/incpath.c
+index cc0c921..0bc1f67 100644
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -394,7 +394,9 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
+ {
+ if ((!strncmp (p->name, "/usr/include", 12))
+ || (!strncmp (p->name, "/usr/local/include", 18))
+- || (!strncmp (p->name, "/usr/X11R6/include", 18)))
++ || (!strncmp (p->name, "/usr/X11R6/include", 18))
++ || (!strncmp (p->name, "/sw/include", 11))
++ || (!strncmp (p->name, "/opt/include", 12)))
+ warning (OPT_Wpoison_system_directories,
+ "include location \"%s\" is unsafe for "
+ "cross-compilation",
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
new file mode 100644
index 000000000..750bbc823
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
@@ -0,0 +1,73 @@
+From 278d293c4cee9482a23aa3443741861ff2f67212 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:08:31 +0400
+Subject: [PATCH 12/46] gcc-4.3.3: SYSROOT_CFLAGS_FOR_TARGET
+
+Before committing, I noticed that PR/32161 was marked as a dup of PR/32009, but my previous patch did not fix it.
+
+This alternative patch is better because it lets you just use CFLAGS_FOR_TARGET to set the compilation flags for libgcc. Since bootstrapped target libraries are never compiled with the native compiler, it makes little sense to use different flags for stage1 and later stages. And it also makes little sense to use a different variable than CFLAGS_FOR_TARGET.
+
+Other changes I had to do include:
+
+- moving the creation of default CFLAGS_FOR_TARGET from Makefile.am to configure.ac, because otherwise the BOOT_CFLAGS are substituted into CFLAGS_FOR_TARGET (which is "-O2 -g $(CFLAGS)") via $(CFLAGS). It is also cleaner this way though.
+
+- passing the right CFLAGS to configure scripts as exported environment variables
+
+I also stopped passing LIBCFLAGS to configure scripts since they are unused in the whole src tree. And I updated the documentation as H-P reminded me to do.
+
+Bootstrapped/regtested i686-pc-linux-gnu, will commit to 4.4 shortly. Ok for 4.3?
+
+Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ configure | 32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+diff --git a/configure b/configure
+index 1cba3a9..9cae8da 100755
+--- a/configure
++++ b/configure
+@@ -6733,6 +6733,38 @@ fi
+
+
+
++# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
++# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS
++# might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
++# We want to ensure that TARGET libraries (which we know are built with
++# gcc) are built with "-O2 -g", so include those options when setting
++# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
++if test "x$CFLAGS_FOR_TARGET" = x; then
++ CFLAGS_FOR_TARGET=$CFLAGS
++ case " $CFLAGS " in
++ *" -O2 "*) ;;
++ *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;;
++ esac
++ case " $CFLAGS " in
++ *" -g "* | *" -g3 "*) ;;
++ *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
++ esac
++fi
++
++
++if test "x$CXXFLAGS_FOR_TARGET" = x; then
++ CXXFLAGS_FOR_TARGET=$CXXFLAGS
++ case " $CXXFLAGS " in
++ *" -O2 "*) ;;
++ *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;;
++ esac
++ case " $CXXFLAGS " in
++ *" -g "* | *" -g3 "*) ;;
++ *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
++ esac
++fi
++
++
+ # Handle --with-headers=XXX. If the value is not "yes", the contents of
+ # the named directory are copied to $(tooldir)/sys-include.
+ if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0013-64-bit-multilib-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0013-64-bit-multilib-hack.patch
new file mode 100644
index 000000000..45aaf4cc2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0013-64-bit-multilib-hack.patch
@@ -0,0 +1,85 @@
+From bdde4f5efa3c89ac7ee0bc05f322f27e3dabeab9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:10:06 +0400
+Subject: [PATCH 13/46] 64-bit multilib hack.
+
+GCC has internal multilib handling code but it assumes a very specific rigid directory
+layout. The build system implementation of multilib layout is very generic and allows
+complete customisation of the library directories.
+
+This patch is a partial solution to allow any custom directories to be passed into gcc
+and handled correctly. It forces gcc to use the base_libdir (which is the current
+directory, "."). We need to do this for each multilib that is configured as we don't
+know which compiler options may be being passed into the compiler. Since we have a compiler
+per mulitlib at this point that isn't an issue.
+
+The one problem is the target compiler is only going to work for the default multlilib at
+this point. Ideally we'd figure out which multilibs were being enabled with which paths
+and be able to patch these entries with a complete set of correct paths but this we
+don't have such code at this point. This is something the target gcc recipe should do
+and override these platform defaults in its build config.
+
+RP 15/8/11
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/i386/t-linux64 | 6 ++----
+ gcc/config/mips/t-linux64 | 10 +++-------
+ gcc/config/rs6000/t-linux64 | 5 ++---
+ 3 files changed, 7 insertions(+), 14 deletions(-)
+
+diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
+index f6dbb78..d770da5 100644
+--- a/gcc/config/i386/t-linux64
++++ b/gcc/config/i386/t-linux64
+@@ -32,7 +32,5 @@
+ #
+ comma=,
+ MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
+-MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
+-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
+-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
+-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
++MULTILIB_DIRNAMES = . .
++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
+diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
+index 7e96406..b72dcb0 100644
+--- a/gcc/config/mips/t-linux64
++++ b/gcc/config/mips/t-linux64
+@@ -17,10 +17,6 @@
+ # <http://www.gnu.org/licenses/>.
+
+ MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
+-MULTILIB_DIRNAMES = n32 32 64
+-MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
+-MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
+-MULTILIB_OSDIRNAMES = \
+- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
+- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
+- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
++MULTILIB_DIRNAMES = . . .
++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
++
+diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
+index b6b351d..1d5b37a 100644
+--- a/gcc/config/rs6000/t-linux64
++++ b/gcc/config/rs6000/t-linux64
+@@ -26,10 +26,9 @@
+ # MULTILIB_OSDIRNAMES according to what is found on the target.
+
+ MULTILIB_OPTIONS := m64/m32
+-MULTILIB_DIRNAMES := 64 32
++MULTILIB_DIRNAMES := . .
+ MULTILIB_EXTRA_OPTS :=
+-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
+-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
++MULTILIB_OSDIRNAMES := ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
+
+ rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
+ $(COMPILE) $<
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0014-optional-libstdc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0014-optional-libstdc.patch
new file mode 100644
index 000000000..73741f83c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0014-optional-libstdc.patch
@@ -0,0 +1,101 @@
+From a13763f8a1d413a432e7b40835a062f86208f29a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:12:56 +0400
+Subject: [PATCH 14/46] optional libstdc
+
+gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++
+will not run correctly since by default the linker will try to link against libstdc++
+which shouldn't exist yet. We need an option to disable -lstdc++
+option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc
+driver. This patch adds such an option which only disables the -lstdc++.
+
+A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to
+do this officially, the likely answer is don't build libstdc++ separately.
+
+RP 29/6/10
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ gcc/c-family/c.opt | 4 ++++
+ gcc/cp/g++spec.c | 1 +
+ gcc/doc/invoke.texi | 8 +++++++-
+ gcc/gcc.c | 1 +
+ 4 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
+index 4162566..453ec8e 100644
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -1543,6 +1543,10 @@ nostdinc++
+ C++ ObjC++
+ Do not search standard system include directories for C++
+
++nostdlib++
++Driver
++Do not link standard C++ runtime library
++
+ o
+ C ObjC C++ ObjC++ Joined Separate
+ ; Documented in common.opt
+diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
+index 6536d7e..f57a5d4 100644
+--- a/gcc/cp/g++spec.c
++++ b/gcc/cp/g++spec.c
+@@ -138,6 +138,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
+ switch (decoded_options[i].opt_index)
+ {
+ case OPT_nostdlib:
++ case OPT_nostdlib__:
+ case OPT_nodefaultlibs:
+ library = -1;
+ break;
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+index c81b55b..6d3f68c 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -195,6 +195,7 @@ in the following sections.
+ -fvisibility-inlines-hidden @gol
+ -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
+ -fvtv-counts -fvtv-debug @gol
++-nostdlib++ @gol
+ -fvisibility-ms-compat @gol
+ -fext-numeric-literals @gol
+ -Wabi=@var{n} -Wabi-tag -Wconversion-null -Wctor-dtor-privacy @gol
+@@ -488,7 +489,7 @@ Objective-C and Objective-C++ Dialects}.
+ -s -static -static-libgcc -static-libstdc++ @gol
+ -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
+ -static-libmpx -static-libmpxwrappers @gol
+--shared -shared-libgcc -symbolic @gol
++-shared -shared-libgcc -symbolic -nostdlib++ @gol
+ -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol
+ -u @var{symbol} -z @var{keyword}}
+
+@@ -11187,6 +11188,11 @@ These entries are usually resolved by entries in
+ libc. These entry points should be supplied through some other
+ mechanism when this option is specified.
+
++@item -nostdlib++
++@opindex nostdlib++
++Do not use the standard system C++ runtime libraries when linking.
++Only the libraries you specify will be passed to the linker.
++
+ @cindex @option{-lgcc}, use with @option{-nostdlib}
+ @cindex @option{-nostdlib} and unresolved references
+ @cindex unresolved references and @option{-nostdlib}
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 675bcc1..a37ec8b 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -845,6 +845,7 @@ proper position among the other output files. */
+ %(mflib) " STACK_SPLIT_SPEC "\
+ %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \
+ %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
++ %{!nostdlib++:}\
+ %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
+ #endif
+
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
new file mode 100644
index 000000000..1b62ef806
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
@@ -0,0 +1,59 @@
+From 4bd21a1d63cfb14e261d90adc0c5d4f9462dc555 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:14:20 +0400
+Subject: [PATCH 15/46] gcc: disable MASK_RELAX_PIC_CALLS bit
+
+The new feature added after 4.3.3
+"http://www.pubbs.net/200909/gcc/94048-patch-add-support-for-rmipsjalr.html"
+will cause cc1plus eat up all the system memory when build webkit-gtk.
+The function mips_get_pic_call_symbol keeps on recursively calling itself.
+Disable this feature to walk aside the bug.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ gcc/configure | 7 -------
+ gcc/configure.ac | 7 -------
+ 2 files changed, 14 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 34371a3..8caecdc 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -26479,13 +26479,6 @@ $as_echo_n "checking assembler and linker for explicit JALR relocation... " >&6;
+ rm -f conftest.*
+ fi
+ fi
+- if test $gcc_cv_as_ld_jalr_reloc = yes; then
+- if test x$target_cpu_default = x; then
+- target_cpu_default=MASK_RELAX_PIC_CALLS
+- else
+- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
+- fi
+- fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ld_jalr_reloc" >&5
+ $as_echo "$gcc_cv_as_ld_jalr_reloc" >&6; }
+
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 240d322..57819ff 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4384,13 +4384,6 @@ x:
+ rm -f conftest.*
+ fi
+ fi
+- if test $gcc_cv_as_ld_jalr_reloc = yes; then
+- if test x$target_cpu_default = x; then
+- target_cpu_default=MASK_RELAX_PIC_CALLS
+- else
+- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
+- fi
+- fi
+ AC_MSG_RESULT($gcc_cv_as_ld_jalr_reloc)
+
+ AC_CACHE_CHECK([linker for .eh_frame personality relaxation],
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0016-COLLECT_GCC_OPTIONS.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0016-COLLECT_GCC_OPTIONS.patch
new file mode 100644
index 000000000..e6ae262e4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0016-COLLECT_GCC_OPTIONS.patch
@@ -0,0 +1,38 @@
+From 92427ebb94dc66f8e64ebf3ffbcd6dd5ce0935c1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:16:28 +0400
+Subject: [PATCH 16/46] COLLECT_GCC_OPTIONS
+
+This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to
+invoke collect2.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/gcc.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index a37ec8b..87b47c5 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -4352,6 +4352,15 @@ set_collect_gcc_options (void)
+ sizeof ("COLLECT_GCC_OPTIONS=") - 1);
+
+ first_time = TRUE;
++#ifdef HAVE_LD_SYSROOT
++ if (target_system_root_changed && target_system_root)
++ {
++ obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1);
++ obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root));
++ obstack_grow (&collect_obstack, "'", 1);
++ first_time = FALSE;
++ }
++#endif
+ for (i = 0; (int) i < n_switches; i++)
+ {
+ const char *const *args;
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/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-5.3/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
new file mode 100644
index 000000000..b89a27919
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
@@ -0,0 +1,96 @@
+From b1f3118e439459c26a3e19c617b7b0c93745e77a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:17:25 +0400
+Subject: [PATCH 17/46] Use the defaults.h in ${B} instead of ${S}, and t-oe in
+ ${B}
+
+Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}, so that
+the source can be shared between gcc-cross-initial,
+gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+While compiling gcc-crosssdk-initial-x86_64 on some host, there is
+occasionally failure that test the existance of default.h doesn't
+work, the reason is tm_include_list='** defaults.h' rather than
+tm_include_list='** ./defaults.h'
+
+So we add the test condition for this situation.
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/Makefile.in | 2 +-
+ gcc/configure | 4 ++--
+ gcc/configure.ac | 4 ++--
+ gcc/mkconfig.sh | 4 ++--
+ 4 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 07c6f0a..e1e63e8 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -502,7 +502,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
+ TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
+
+ xmake_file=@xmake_file@
+-tmake_file=@tmake_file@
++tmake_file=@tmake_file@ ./t-oe
+ TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@
+ TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
+ TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
+diff --git a/gcc/configure b/gcc/configure
+index 8caecdc..8ec3d40 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11850,8 +11850,8 @@ for f in $tm_file; do
+ tm_include_list="${tm_include_list} $f"
+ ;;
+ defaults.h )
+- tm_file_list="${tm_file_list} \$(srcdir)/$f"
+- tm_include_list="${tm_include_list} $f"
++ tm_file_list="${tm_file_list} ./$f"
++ tm_include_list="${tm_include_list} ./$f"
+ ;;
+ * )
+ tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 57819ff..643a47e 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1832,8 +1832,8 @@ for f in $tm_file; do
+ tm_include_list="${tm_include_list} $f"
+ ;;
+ defaults.h )
+- tm_file_list="${tm_file_list} \$(srcdir)/$f"
+- tm_include_list="${tm_include_list} $f"
++ tm_file_list="${tm_file_list} ./$f"
++ tm_include_list="${tm_include_list} ./$f"
+ ;;
+ * )
+ tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
+index c32f087..6803ab9 100644
+--- a/gcc/mkconfig.sh
++++ b/gcc/mkconfig.sh
+@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then
+ if [ $# -ge 1 ]; then
+ echo '#ifdef IN_GCC' >> ${output}T
+ for file in "$@"; do
+- if test x"$file" = x"defaults.h"; then
++ if test x"$file" = x"./defaults.h" -o x"$file" = x"defaults.h"; then
+ postpone_defaults_h="yes"
+ else
+ echo "# include \"$file\"" >> ${output}T
+@@ -109,7 +109,7 @@ esac
+
+ # If we postponed including defaults.h, add the #include now.
+ if test x"$postpone_defaults_h" = x"yes"; then
+- echo "# include \"defaults.h\"" >> ${output}T
++ echo "# include \"./defaults.h\"" >> ${output}T
+ fi
+
+ # Add multiple inclusion protection guard, part two.
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0018-fortran-cross-compile-hack.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0018-fortran-cross-compile-hack.patch
new file mode 100644
index 000000000..e8ba32558
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0018-fortran-cross-compile-hack.patch
@@ -0,0 +1,46 @@
+From d11c73c1295565ff3766ae04e2a410a89fc84dd5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:20:01 +0400
+Subject: [PATCH 18/46] fortran cross-compile hack.
+
+* Fortran would have searched for arm-angstrom-gnueabi-gfortran but would have used
+used gfortan. For gcc_4.2.2.bb we want to use the gfortran compiler from our cross
+directory.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ libgfortran/configure | 2 +-
+ libgfortran/configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgfortran/configure b/libgfortran/configure
+index bb3107b..5d47e65 100755
+--- a/libgfortran/configure
++++ b/libgfortran/configure
+@@ -12747,7 +12747,7 @@ esac
+
+ # We need gfortran to compile parts of the library
+ #AC_PROG_FC(gfortran)
+-FC="$GFORTRAN"
++#FC="$GFORTRAN"
+ ac_ext=${ac_fc_srcext-f}
+ ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
+index adafb3f..b4ade28 100644
+--- a/libgfortran/configure.ac
++++ b/libgfortran/configure.ac
+@@ -240,7 +240,7 @@ AC_SUBST(enable_static)
+
+ # We need gfortran to compile parts of the library
+ #AC_PROG_FC(gfortran)
+-FC="$GFORTRAN"
++#FC="$GFORTRAN"
+ AC_PROG_FC(gfortran)
+
+ # extra LD Flags which are required for targets
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0019-libgcc-sjlj-check.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0019-libgcc-sjlj-check.patch
new file mode 100644
index 000000000..01a4d1fda
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0019-libgcc-sjlj-check.patch
@@ -0,0 +1,74 @@
+From 7b40212ed6c0c9fe4efe51f31bccd3d9f892f238 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:20:50 +0400
+Subject: [PATCH 19/46] libgcc-sjlj-check
+
+ac_fn_c_try_compile doesnt seem to keep the intermediate files
+which are needed for sjlj test to pass since it greps into the
+generated file. So we run the compiler command using AC_TRY_COMMAND
+which then generates the needed .s file
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libgcc/configure | 10 ++++++----
+ libgcc/configure.ac | 10 ++++------
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/libgcc/configure b/libgcc/configure
+index 203d384..6aef3e7 100644
+--- a/libgcc/configure
++++ b/libgcc/configure
+@@ -4570,17 +4570,19 @@ void foo ()
+ }
+
+ _ACEOF
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-if ac_fn_c_try_compile; then :
++if { ac_try='${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&5'
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; }; then
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=no
+ fi
+ fi
+-CFLAGS=$CFLAGS_hold
+ rm -f conftest*
+
+ fi
+diff --git a/libgcc/configure.ac b/libgcc/configure.ac
+index a10a952..cc324f3 100644
+--- a/libgcc/configure.ac
++++ b/libgcc/configure.ac
+@@ -255,16 +255,14 @@ void foo ()
+ bar();
+ }
+ ])])
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-AS_IF([ac_fn_c_try_compile],
+- [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
++if AC_TRY_COMMAND(${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
++ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+ libgcc_cv_lib_sjlj_exceptions=no
+- fi])
+-CFLAGS=$CFLAGS_hold
++ fi
++fi
+ rm -f conftest*
+ ])
+
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0020-cpp-honor-sysroot.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0020-cpp-honor-sysroot.patch
new file mode 100644
index 000000000..13f66d413
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0020-cpp-honor-sysroot.patch
@@ -0,0 +1,54 @@
+From 5f9759a85fff3d78e3f71ae01c970b10d326c406 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:22:00 +0400
+Subject: [PATCH 20/46] cpp: honor sysroot.
+
+Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile
+preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location
+rather than the --sysroot option specified on the commandline. If access to that directory is
+permission denied (unreadable), gcc will error.
+
+This happens when ccache is in use due to the fact it uses preprocessed source files.
+
+The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix,
+-isystem, -isysroot happen and the correct sysroot is used.
+
+[YOCTO #2074]
+
+RP 2012/04/13
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/cp/lang-specs.h | 2 +-
+ gcc/gcc.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
+index b0728f0..e69ee7d 100644
+--- a/gcc/cp/lang-specs.h
++++ b/gcc/cp/lang-specs.h
+@@ -63,5 +63,5 @@ along with GCC; see the file COPYING3. If not see
+ {".ii", "@c++-cpp-output", 0, 0, 0},
+ {"@c++-cpp-output",
+ "%{!M:%{!MM:%{!E:\
+- cc1plus -fpreprocessed %i %(cc1_options) %2\
++ cc1plus -fpreprocessed %i %I %(cc1_options) %2\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 87b47c5..e6efae7 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1142,7 +1142,7 @@ static const struct compiler default_compilers[] =
+ %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0},
+ {".i", "@cpp-output", 0, 0, 0},
+ {"@cpp-output",
+- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
++ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ {".s", "@assembler", 0, 0, 0},
+ {"@assembler",
+ "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0021-MIPS64-Default-to-N64-ABI.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0021-MIPS64-Default-to-N64-ABI.patch
new file mode 100644
index 000000000..c7cffe417
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0021-MIPS64-Default-to-N64-ABI.patch
@@ -0,0 +1,57 @@
+From 34d22ab6cfd2dfe6dd171c8d0b31cafcdeb86298 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:23:08 +0400
+Subject: [PATCH 21/46] MIPS64: Default to N64 ABI
+
+MIPS64 defaults to n32 ABI, this patch makes it
+so that it defaults to N64 ABI
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE config specific]
+---
+ gcc/config.gcc | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index c835734..dd0739d 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -2017,29 +2017,29 @@ mips*-*-linux*) # Linux MIPS, either endian.
+ default_mips_arch=mips32
+ ;;
+ mips64el-st-linux-gnu)
+- default_mips_abi=n32
++ default_mips_abi=64
+ tm_file="${tm_file} mips/st.h"
+ tmake_file="${tmake_file} mips/t-st"
+ enable_mips_multilibs="yes"
+ ;;
+ mips64octeon*-*-linux*)
+- default_mips_abi=n32
++ default_mips_abi=64
+ tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
+ target_cpu_default=MASK_SOFT_FLOAT_ABI
+ enable_mips_multilibs="yes"
+ ;;
+ mipsisa64r6*-*-linux*)
+- default_mips_abi=n32
++ default_mips_abi=64
+ default_mips_arch=mips64r6
+ enable_mips_multilibs="yes"
+ ;;
+ mipsisa64r2*-*-linux*)
+- default_mips_abi=n32
++ default_mips_abi=64
+ default_mips_arch=mips64r2
+ enable_mips_multilibs="yes"
+ ;;
+ mips64*-*-linux* | mipsisa64*-*-linux*)
+- default_mips_abi=n32
++ default_mips_abi=64
+ enable_mips_multilibs="yes"
+ ;;
+ esac
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
new file mode 100644
index 000000000..620835132
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
@@ -0,0 +1,216 @@
+From f6b41b62ea62a0f1447d9fc235f7fd2bbf3fe7c2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:24:50 +0400
+Subject: [PATCH 22/46] Define GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
+ relative to SYSTEMLIBS_DIR
+
+This patch defines GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
+relative to SYSTEMLIBS_DIR which can be set in generated headers
+This breaks the assumption of hardcoded multilib in gcc
+Change is only for the supported architectures in OE including
+SH, sparc, alpha for possible future support (if any)
+
+Removes the do_headerfix task in metadata
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE configuration]
+---
+ gcc/config/alpha/linux-elf.h | 4 ++--
+ gcc/config/arm/linux-eabi.h | 4 ++--
+ gcc/config/arm/linux-elf.h | 2 +-
+ gcc/config/i386/linux.h | 2 +-
+ gcc/config/i386/linux64.h | 6 +++---
+ gcc/config/linux.h | 8 ++++----
+ gcc/config/mips/linux.h | 12 ++++++------
+ gcc/config/rs6000/linux64.h | 10 +++++-----
+ gcc/config/sh/linux.h | 2 +-
+ gcc/config/sparc/linux.h | 2 +-
+ gcc/config/sparc/linux64.h | 4 ++--
+ 11 files changed, 28 insertions(+), 28 deletions(-)
+
+diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
+index 2c70a2f..dd048db 100644
+--- a/gcc/config/alpha/linux-elf.h
++++ b/gcc/config/alpha/linux-elf.h
+@@ -23,8 +23,8 @@ along with GCC; see the file COPYING3. If not see
+ #define EXTRA_SPECS \
+ { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
++#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index e9d65dc..cfdf3f0 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -68,8 +68,8 @@
+ GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */
+
+ #undef GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
+-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
++#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT SYSTEMLIBS_DIR "ld-linux.so.3"
++#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT SYSTEMLIBS_DIR "ld-linux-armhf.so.3"
+ #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
+
+ #define GLIBC_DYNAMIC_LINKER \
+diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
+index 49ad954..a5ab559 100644
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -62,7 +62,7 @@
+
+ #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+
+ #define LINUX_TARGET_LINK_SPEC "%{h*} \
+ %{static:-Bstatic} \
+diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
+index a100963..21ba2b2 100644
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -20,4 +20,4 @@ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
+index a27d3be..6185cce 100644
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -27,6 +27,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
+ #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
+-#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2"
+diff --git a/gcc/config/linux.h b/gcc/config/linux.h
+index 857389a..22b9be5 100644
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -73,10 +73,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
+ GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
+ supporting both 32-bit and 64-bit compilation. */
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKERX32 "/lib/ldx32-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ldx32-uClibc.so.0"
+ #define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
+diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
+index 91df261..c306afb 100644
+--- a/gcc/config/mips/linux.h
++++ b/gcc/config/mips/linux.h
+@@ -22,20 +22,20 @@ along with GCC; see the file COPYING3. If not see
+ #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
+
+ #define GLIBC_DYNAMIC_LINKER32 \
+- "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ #define GLIBC_DYNAMIC_LINKER64 \
+- "%{mnan=2008:/lib64/ld-linux-mipsn8.so.1;:/lib64/ld.so.1}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ #define GLIBC_DYNAMIC_LINKERN32 \
+- "%{mnan=2008:/lib32/ld-linux-mipsn8.so.1;:/lib32/ld.so.1}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+
+ #undef UCLIBC_DYNAMIC_LINKER32
+ #define UCLIBC_DYNAMIC_LINKER32 \
+- "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+ #undef UCLIBC_DYNAMIC_LINKER64
+ #define UCLIBC_DYNAMIC_LINKER64 \
+- "%{mnan=2008:/lib/ld64-uClibc-mipsn8.so.0;:/lib/ld64-uClibc.so.0}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld64-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld64-uClibc.so.0}"
+ #define UCLIBC_DYNAMIC_LINKERN32 \
+- "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
+index 0879e7e..31c4338 100644
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -357,14 +357,14 @@ extern int dot_symbols;
+ #undef LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1"
+ #ifdef LINUX64_DEFAULT_ABI_ELFv2
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/lib64/ld64.so.2}"
++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:" SYSTEMLIBS_DIR "ld64.so.1;:" SYSTEMLIBS_DIR "ld64.so.2}"
+ #else
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/lib64/ld64.so.2;:/lib64/ld64.so.1}"
++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:" SYSTEMLIBS_DIR "ld64.so.2;:" SYSTEMLIBS_DIR "ld64.so.1}"
+ #endif
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
+index 0f5d614..168416c 100644
+--- a/gcc/config/sh/linux.h
++++ b/gcc/config/sh/linux.h
+@@ -43,7 +43,7 @@ along with GCC; see the file COPYING3. If not see
+
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+ #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
+diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
+index 56def4b..00b564c 100644
+--- a/gcc/config/sparc/linux.h
++++ b/gcc/config/sparc/linux.h
+@@ -83,7 +83,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
+ When the -shared link option is used a final link is not being
+ done. */
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
+diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
+index fa805fd..0eb4acd 100644
+--- a/gcc/config/sparc/linux64.h
++++ b/gcc/config/sparc/linux64.h
+@@ -84,8 +84,8 @@ along with GCC; see the file COPYING3. If not see
+ When the -shared link option is used a final link is not being
+ done. */
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux.so.2"
+
+ #ifdef SPARC_BI_ARCH
+
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0023-gcc-Fix-argument-list-too-long-error.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0023-gcc-Fix-argument-list-too-long-error.patch
new file mode 100644
index 000000000..be91c9e63
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0023-gcc-Fix-argument-list-too-long-error.patch
@@ -0,0 +1,40 @@
+From 9701f596bbe5bf51bbf48661bc515b45d4b6f4d2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:26:37 +0400
+Subject: [PATCH 23/46] gcc: Fix argument list too long error.
+
+There would be an "Argument list too long" error when the
+build directory is longer than 200, this is caused by:
+
+headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`
+
+The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle
+it, use the $(sort list) of GNU make which can handle the too long list
+would fix the problem, the header would be short enough after sorted.
+The "tr ' ' '\012'" was used for translating the space to "\n", the
+$(sort list) doesn't need this.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index e1e63e8..7b49f88 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -3262,7 +3262,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
+ # We keep the directory structure for files in config or c-family and .def
+ # files. All other files are flattened to a single directory.
+ $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
+- headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
++ headers="$(sort $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def))"; \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
+ for file in $$headers; do \
+ if [ -f $$file ] ; then \
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0024-Disable-sdt.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0024-Disable-sdt.patch
new file mode 100644
index 000000000..b23ce9756
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0024-Disable-sdt.patch
@@ -0,0 +1,113 @@
+From 946e047614103e1f2982613c7aa5f76587500c0e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:28:10 +0400
+Subject: [PATCH 24/46] Disable sdt.
+
+We don't list dtrace in DEPENDS so we shouldn't be depending on this header.
+It may or may not exist from preivous builds though. To be determinstic, disable
+sdt.h usage always. This avoids build failures if the header is removed after configure
+but before libgcc is compiled for example.
+
+RP 2012/8/7
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Disable sdt for libstdc++-v3.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Upstream-Status: Inappropriate [hack]
+---
+ gcc/configure | 12 ++++++------
+ gcc/configure.ac | 18 +++++++++---------
+ libstdc++-v3/configure | 6 +++---
+ libstdc++-v3/configure.ac | 2 +-
+ 4 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 8ec3d40..eaa3b07 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -27857,12 +27857,12 @@ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
+ $as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
+ have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+- have_sys_sdt_h=yes
+-
+-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+-
+-fi
++#if test -f $target_header_dir/sys/sdt.h; then
++# have_sys_sdt_h=yes
++#
++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
++#
++#fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
+ $as_echo "$have_sys_sdt_h" >&6; }
+
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 643a47e..9f6cacb 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5315,15 +5315,15 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then
+ fi
+
+ # Test for <sys/sdt.h> on the target.
+-GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
+-AC_MSG_CHECKING(sys/sdt.h in the target C library)
+-have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+- have_sys_sdt_h=yes
+- AC_DEFINE(HAVE_SYS_SDT_H, 1,
+- [Define if your target C library provides sys/sdt.h])
+-fi
+-AC_MSG_RESULT($have_sys_sdt_h)
++#GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
++#AC_MSG_CHECKING(sys/sdt.h in the target C library)
++#have_sys_sdt_h=no
++#if test -f $target_header_dir/sys/sdt.h; then
++# have_sys_sdt_h=yes
++# AC_DEFINE(HAVE_SYS_SDT_H, 1,
++# [Define if your target C library provides sys/sdt.h])
++#fi
++#AC_MSG_RESULT($have_sys_sdt_h)
+
+ # Check if TFmode long double should be used by default or not.
+ # Some glibc targets used DFmode long double, but with glibc 2.4
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index 217012e..81240b9 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -20964,11 +20964,11 @@ 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_compiler_gnu=$ac_cv_c_compiler_gnu
+
+- if test $glibcxx_cv_sys_sdt_h = yes; then
++# if test $glibcxx_cv_sys_sdt_h = yes; then
+
+-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+
+- fi
++# fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_sys_sdt_h" >&5
+ $as_echo "$glibcxx_cv_sys_sdt_h" >&6; }
+
+diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
+index 580fb8b..5a41083 100644
+--- a/libstdc++-v3/configure.ac
++++ b/libstdc++-v3/configure.ac
+@@ -230,7 +230,7 @@ GLIBCXX_CHECK_SC_NPROCESSORS_ONLN
+ GLIBCXX_CHECK_SC_NPROC_ONLN
+ GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP
+ GLIBCXX_CHECK_SYSCTL_HW_NCPU
+-GLIBCXX_CHECK_SDT_H
++#GLIBCXX_CHECK_SDT_H
+
+ # Check for available headers.
+ AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0025-libtool.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0025-libtool.patch
new file mode 100644
index 000000000..8d5eb973b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0025-libtool.patch
@@ -0,0 +1,42 @@
+From f68c5b78751660505b22b46dad99240db0df3456 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:29:11 +0400
+Subject: [PATCH 25/46] libtool
+
+libstdc++ from gcc-runtime gets created with -rpath=/usr/lib/../lib for qemux86-64
+when running on am x86_64 build host.
+
+This patch stops this speading to libdir in the libstdc++.la file within libtool.
+Arguably, it shouldn't be passing this into libtool in the first place but
+for now this resolves the nastiest problems this causes.
+
+func_normal_abspath would resolve an empty path to `pwd` so we need
+to filter the zero case.
+
+RP 2012/8/24
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ ltmain.sh | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 9503ec8..0121fba 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -6359,6 +6359,10 @@ func_mode_link ()
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
++ if test -n "$install_libdir"; then
++ func_normal_abspath "$install_libdir"
++ install_libdir=$func_normal_abspath_result
++ fi
+
+ oldlibs=
+ if test -z "$rpath"; then
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
new file mode 100644
index 000000000..a22d95f72
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
@@ -0,0 +1,43 @@
+From 4c75e349aa7abd1e285720328b23690636bea242 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:30:32 +0400
+Subject: [PATCH 26/46] gcc: armv4: pass fix-v4bx to linker to support EABI.
+
+The LINK_SPEC for linux gets overwritten by linux-eabi.h which
+means the value of TARGET_FIX_V4BX_SPEC gets lost and as a result
+the option is not passed to linker when chosing march=armv4
+This patch redefines this in linux-eabi.h and reinserts it
+for eabi defaulting toolchains.
+
+We might want to send it upstream.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/arm/linux-eabi.h | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index cfdf3f0..048a062 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -77,10 +77,14 @@
+ %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
+ %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
+
++/* For armv4 we pass --fix-v4bx to linker to support EABI */
++#undef TARGET_FIX_V4BX_SPEC
++#define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}"
++
+ /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
+ use the GNU/Linux version, not the generic BPABI version. */
+ #undef LINK_SPEC
+-#define LINK_SPEC EABI_LINK_SPEC \
++#define LINK_SPEC TARGET_FIX_V4BX_SPEC EABI_LINK_SPEC \
+ LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
+ LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
+
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch
new file mode 100644
index 000000000..46815d156
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch
@@ -0,0 +1,102 @@
+From 8217dd7fb318f9abc6564f67b424c433d8398d61 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:33:04 +0400
+Subject: [PATCH 27/46] Use the multilib config files from ${B} instead of
+ using the ones from ${S}
+
+Use the multilib config files from ${B} instead of using the ones from ${S}
+so that the source can be shared between gcc-cross-initial,
+gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ gcc/configure | 22 ++++++++++++++++++----
+ gcc/configure.ac | 22 ++++++++++++++++++----
+ 2 files changed, 36 insertions(+), 8 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index eaa3b07..9b60aad 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11830,10 +11830,20 @@ done
+ tmake_file_=
+ for f in ${tmake_file}
+ do
+- if test -f ${srcdir}/config/$f
+- then
+- tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
+- fi
++ case $f in
++ */t-linux64 )
++ if test -f ./config/$f
++ then
++ tmake_file_="${tmake_file_} ./config/$f"
++ fi
++ ;;
++ * )
++ if test -f ${srcdir}/config/$f
++ then
++ tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
++ fi
++ ;;
++ esac
+ done
+ tmake_file="${tmake_file_}"
+
+@@ -11844,6 +11854,10 @@ tm_file_list="options.h"
+ tm_include_list="options.h insn-constants.h"
+ for f in $tm_file; do
+ case $f in
++ */linux64.h )
++ tm_file_list="${tm_file_list} ./config/$f"
++ tm_include_list="${tm_include_list} ./config/$f"
++ ;;
+ ./* )
+ f=`echo $f | sed 's/^..//'`
+ tm_file_list="${tm_file_list} $f"
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 9f6cacb..e1e54f2 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1812,10 +1812,20 @@ done
+ tmake_file_=
+ for f in ${tmake_file}
+ do
+- if test -f ${srcdir}/config/$f
+- then
+- tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
+- fi
++ case $f in
++ */t-linux64 )
++ if test -f ./config/$f
++ then
++ tmake_file_="${tmake_file_} ./config/$f"
++ fi
++ ;;
++ * )
++ if test -f ${srcdir}/config/$f
++ then
++ tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
++ fi
++ ;;
++ esac
+ done
+ tmake_file="${tmake_file_}"
+
+@@ -1826,6 +1836,10 @@ tm_file_list="options.h"
+ tm_include_list="options.h insn-constants.h"
+ for f in $tm_file; do
+ case $f in
++ */linux64.h )
++ tm_file_list="${tm_file_list} ./config/$f"
++ tm_include_list="${tm_include_list} ./config/$f"
++ ;;
+ ./* )
+ f=`echo $f | sed 's/^..//'`
+ tm_file_list="${tm_file_list} $f"
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
new file mode 100644
index 000000000..60ddd9cee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
@@ -0,0 +1,31 @@
+From 08a0e45b308fc97d06f5c3ef77a257e7a6bd1a48 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 09:39:38 +0000
+Subject: [PATCH 28/46] Avoid using libdir from .la which usually points to a
+ host path
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ltmain.sh | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 0121fba..52bdbdb 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -5628,6 +5628,9 @@ func_mode_link ()
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
++ # Instead of using libdir from .la which usually points to a host path,
++ # use the path the .la is contained in.
++ libdir="$abs_ladir"
+ dir="$libdir"
+ absdir="$libdir"
+ fi
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0029-export-CPP.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0029-export-CPP.patch
new file mode 100644
index 000000000..62195aa87
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0029-export-CPP.patch
@@ -0,0 +1,53 @@
+From 95f494d1544857ad38949a7da37e2d7264475233 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 09:40:59 +0000
+Subject: [PATCH 29/46] export CPP
+
+The OE environment sets and exports CPP as being the target gcc. When
+building gcc-cross-canadian for a mingw targetted sdk, the following can be found
+in build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log:
+
+configure:3641: checking for _FILE_OFFSET_BITS value needed for large files
+configure:3666: gcc -c -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe conftest.c >&5
+configure:3666: $? = 0
+configure:3698: result: no
+configure:3786: checking how to run the C preprocessor
+configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32
+configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 conftest.c
+configure:3876: $? = 0
+
+Note this is a *build* target (in build-x86_64-linux) so it should be
+using the host "gcc", not x86_64-pokysdk-mingw32-gcc. Since the mingw32
+headers are very different, using the wrong cpp is a real problem. It is leaking
+into configure through the CPP variable. Ultimately this leads to build
+failures related to not being able to include a process.h file for pem-unix.c.
+
+The fix is to ensure we export a sane CPP value into the build
+environment when using build targets. We could define a CPP_FOR_BUILD value which may be
+the version which needs to be upstreamed but for now, this fix is good enough to
+avoid the problem.
+
+RP 22/08/2013
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.in b/Makefile.in
+index 36b4008..a783e1e 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -149,6 +149,7 @@ BUILD_EXPORTS = \
+ AR="$(AR_FOR_BUILD)"; export AR; \
+ AS="$(AS_FOR_BUILD)"; export AS; \
+ CC="$(CC_FOR_BUILD)"; export CC; \
++ CPP="$(CC_FOR_BUILD) -E"; export CPP; \
+ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+ CXX="$(CXX_FOR_BUILD)"; export CXX; \
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
new file mode 100644
index 000000000..57051871b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
@@ -0,0 +1,52 @@
+From 4ed8c1fd9dc05f7a9db9298a55396c8f0ff549a7 Mon Sep 17 00:00:00 2001
+From: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
+Date: Wed, 5 Feb 2014 16:52:31 +0200
+Subject: [PATCH 30/46] Enable SPE & AltiVec generation on powepc*linux target
+
+When is configured with --target=powerpc-linux, the resulting GCC will
+not be able to generate code for SPE targets (e500v1/v2).
+GCC configured with --target=powerpc-linuxspe will not be able to
+generate AltiVec instructions (for e6500).
+This patch modifies the configured file such that SPE or AltiVec code
+can be generated when gcc is configured with --target=powerpc-linux.
+The ABI and speciffic instructions can be selected through the
+"-mabi=spe or -mabi=altivec" and the "-mspe or -maltivec" parameters.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
+---
+ gcc/config.gcc | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+Index: gcc-5.3.0/gcc/config.gcc
+===================================================================
+--- gcc-5.3.0.orig/gcc/config.gcc
++++ gcc-5.3.0/gcc/config.gcc
+@@ -2346,7 +2346,14 @@ powerpc-*-rtems*)
+ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
+ ;;
+ powerpc*-*-linux*)
+- tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
++ case ${target} in
++ powerpc*-*-linux*spe* | powerpc*-*-linux*altivec*)
++ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
++ ;;
++ *)
++ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h rs6000/linuxaltivec.h rs6000/linuxspe.h rs6000/e500.h"
++ ;;
++ esac
+ extra_options="${extra_options} rs6000/sysv4.opt"
+ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm"
+ extra_objs="$extra_objs rs6000-linux.o"
+Index: gcc-5.3.0/gcc/config/rs6000/linuxspe.h
+===================================================================
+--- gcc-5.3.0.orig/gcc/config/rs6000/linuxspe.h
++++ gcc-5.3.0/gcc/config/rs6000/linuxspe.h
+@@ -27,6 +27,3 @@
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT MASK_STRICT_ALIGN
+ #endif
+-
+-#undef ASM_DEFAULT_SPEC
+-#define ASM_DEFAULT_SPEC "-mppc -mspe -me500"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch
new file mode 100644
index 000000000..f2bc66432
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch
@@ -0,0 +1,42 @@
+From bb6fea821483aa3259b34e101a39c993edd01411 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 10:21:55 +0000
+Subject: [PATCH 31/46] Disable the MULTILIB_OSDIRNAMES and other multilib
+ options.
+
+Hard coding the MULTILIB_OSDIRNAMES with ../lib64 is causing problems on
+systems where the libdir is NOT set to /lib64. This is allowed by the
+ABI, as
+long as the dynamic loader is present in /lib.
+
+We simply want to use the default rules in gcc to find and configure the
+normal libdir.
+
+Upstream-Status: Inappropriate[OE-Specific]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/aarch64/t-aarch64-linux | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
+index c296376..3bb59bf 100644
+--- a/gcc/config/aarch64/t-aarch64-linux
++++ b/gcc/config/aarch64/t-aarch64-linux
+@@ -21,8 +21,8 @@
+ LIB1ASMSRC = aarch64/lib1funcs.asm
+ LIB1ASMFUNCS = _aarch64_sync_cache_range
+
+-AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
+-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
+-MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
++#AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
++#MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
++#MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
+
+-MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
++#MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0032-Ensure-target-gcc-headers-can-be-included.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0032-Ensure-target-gcc-headers-can-be-included.patch
new file mode 100644
index 000000000..89503ff60
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0032-Ensure-target-gcc-headers-can-be-included.patch
@@ -0,0 +1,98 @@
+From bb26f90f5e0accc3539f62b6fec663682959dd36 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 10:25:11 +0000
+Subject: [PATCH 32/46] Ensure target gcc headers can be included
+
+There are a few headers installed as part of the OpenEmbedded
+gcc-runtime target (omp.h, ssp/*.h). Being installed from a recipe
+built for the target architecture, these are within the target
+sysroot and not cross/nativesdk; thus they weren't able to be
+found by gcc with the existing search paths. Add support for
+picking up these headers under the sysroot supplied on the gcc
+command line in order to resolve this.
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/Makefile.in | 2 ++
+ gcc/cppdefault.c | 4 ++++
+ gcc/defaults.h | 9 +++++++++
+ gcc/gcc.c | 7 -------
+ 4 files changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 7b49f88..cd5bc4a 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -582,6 +582,7 @@ libexecdir = @libexecdir@
+
+ # Directory in which the compiler finds libraries etc.
+ libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
++libsubdir_target = gcc/$(target_noncanonical)/$(version)
+ # Directory in which the compiler finds executables
+ libexecsubdir = $(libexecdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
+ # Directory in which all plugin resources are installed
+@@ -2610,6 +2611,7 @@ CFLAGS-intl.o += -DLOCALEDIR=\"$(localedir)\"
+
+ PREPROCESSOR_DEFINES = \
+ -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
++ -DGCC_INCLUDE_SUBDIR_TARGET=\"$(libsubdir_target)/include\" \
+ -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
+ -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
+ -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
+diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
+index 580c1ba..03a0287 100644
+--- a/gcc/cppdefault.c
++++ b/gcc/cppdefault.c
+@@ -59,6 +59,10 @@ const struct default_include cpp_include_defaults[]
+ /* This is the dir for gcc's private headers. */
+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
+ #endif
++#ifdef GCC_INCLUDE_SUBDIR_TARGET
++ /* This is the dir for gcc's private headers under the specified sysroot. */
++ { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
++#endif
+ #ifdef LOCAL_INCLUDE_DIR
+ /* /usr/local/include comes before the fixincluded header files. */
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+diff --git a/gcc/defaults.h b/gcc/defaults.h
+index 1d54798..983d45e 100644
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -1361,4 +1361,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+
+ #endif /* GCC_INSN_FLAGS_H */
+
++/* Default prefixes to attach to command names. */
++
++#ifndef STANDARD_STARTFILE_PREFIX_1
++#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
++#endif
++#ifndef STANDARD_STARTFILE_PREFIX_2
++#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
++#endif
++
+ #endif /* ! GCC_DEFAULTS_H */
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index e6efae7..3ca27b9 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1263,13 +1263,6 @@ static const char *gcc_libexec_prefix;
+
+ /* Default prefixes to attach to command names. */
+
+-#ifndef STANDARD_STARTFILE_PREFIX_1
+-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+-#endif
+-#ifndef STANDARD_STARTFILE_PREFIX_2
+-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
+-#endif
+-
+ #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */
+ #undef MD_EXEC_PREFIX
+ #undef MD_STARTFILE_PREFIX
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch
new file mode 100644
index 000000000..19d480f3d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch
@@ -0,0 +1,54 @@
+From 629fcc7d0075c9b4261da6435e122429fb028ec0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 11:17:19 +0000
+Subject: [PATCH 33/46] gcc 4.8+ won't build with --disable-dependency-tracking
+
+since the *.Ppo files don't get created unless --enable-dependency-tracking is true.
+
+This patch ensures we only use those compiler options when its enabled.
+
+Upstream-Status: Submitted
+
+(Problem was already reported upstream, attached this patch there
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55930)
+
+RP
+2012/09/22
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libatomic/Makefile.am | 3 ++-
+ libatomic/Makefile.in | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am
+index 3d8ab62..23dff7e 100644
+--- a/libatomic/Makefile.am
++++ b/libatomic/Makefile.am
+@@ -101,7 +101,8 @@ PAT_S = $(word 3,$(PAT_SPLIT))
+ IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
+ IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
+
+-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_FALSE@M_DEPS =
+ M_SIZE = -DN=$(PAT_N)
+ M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
+ M_FILE = $(PAT_BASE)_n.c
+diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in
+index 9288652..3720256 100644
+--- a/libatomic/Makefile.in
++++ b/libatomic/Makefile.in
+@@ -330,7 +330,8 @@ PAT_N = $(word 2,$(PAT_SPLIT))
+ PAT_S = $(word 3,$(PAT_SPLIT))
+ IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
+ IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
+-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_FALSE@M_DEPS =
+ M_SIZE = -DN=$(PAT_N)
+ M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
+ M_FILE = $(PAT_BASE)_n.c
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch
new file mode 100644
index 000000000..a453fa6b3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch
@@ -0,0 +1,38 @@
+From a4efc9ca85734c283d4da09b628121e1c1f49c4e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 3 Mar 2015 08:21:19 +0000
+Subject: [PATCH 34/46] Don't search host directory during "relink" if
+ $inst_prefix is provided
+
+http://lists.gnu.org/archive/html/libtool-patches/2011-01/msg00026.html
+
+Upstream-Status: Submitted
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ltmain.sh | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 52bdbdb..82bcec3 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -6004,12 +6004,13 @@ func_mode_link ()
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
++ # Default if $libdir is not relative to the prefix:
+ add_dir="-L$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"
++ add_dir="-L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0035-Dont-link-the-plugins-with-libgomp-explicitly.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0035-Dont-link-the-plugins-with-libgomp-explicitly.patch
new file mode 100644
index 000000000..6ed589beb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0035-Dont-link-the-plugins-with-libgomp-explicitly.patch
@@ -0,0 +1,83 @@
+From 5b0125a792842ae02df507bc55555661cb10f9a3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 8 Mar 2015 03:41:39 +0000
+Subject: [PATCH 35/46] Dont link the plugins with libgomp explicitly
+
+They are dlopened by libgomp anyway. This fixes
+the libtool relink issue which causes issues during
+cross compilation
+
+libtool: install: /usr/bin/install -c .libs/libgomp.lai
+/home/ubuntu/work/bleeding/build-qemux86-64mc/tmp/work/core2-64-rdk-linux/gcc-runtime/5.0-r0/image/usr/lib/../lib/libgomp.la
+libtool: install: error: cannot install `libgomp-plugin-host_nonshm.la'
+to a directory not ending in /usr/lib
+Makefile:517: recipe for target 'install-toolexeclibLTLIBRARIES' failed
+make[2]: *** [install-toolexeclibLTLIBRARIES] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libgomp/Makefile.in | 7 +++----
+ libgomp/plugin/Makefrag.am | 3 +--
+ 2 files changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in
+index b61b108..71b2627 100644
+--- a/libgomp/Makefile.in
++++ b/libgomp/Makefile.in
+@@ -123,7 +123,7 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" \
+ "$(DESTDIR)$(fincludedir)" "$(DESTDIR)$(libsubincludedir)" \
+ "$(DESTDIR)$(toolexeclibdir)"
+ LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
+-libgomp_plugin_host_nonshm_la_DEPENDENCIES = libgomp.la
++libgomp_plugin_host_nonshm_la_LIBADD =
+ am_libgomp_plugin_host_nonshm_la_OBJECTS = \
+ libgomp_plugin_host_nonshm_la-plugin-host.lo
+ libgomp_plugin_host_nonshm_la_OBJECTS = \
+@@ -133,7 +133,7 @@ libgomp_plugin_host_nonshm_la_LINK = $(LIBTOOL) --tag=CC \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libgomp_plugin_host_nonshm_la_LDFLAGS) $(LDFLAGS) -o $@
+ am__DEPENDENCIES_1 =
+-@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_DEPENDENCIES = libgomp.la \
++@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_DEPENDENCIES = \
+ @PLUGIN_NVPTX_TRUE@ $(am__DEPENDENCIES_1)
+ @PLUGIN_NVPTX_TRUE@am_libgomp_plugin_nvptx_la_OBJECTS = \
+ @PLUGIN_NVPTX_TRUE@ libgomp_plugin_nvptx_la-plugin-nvptx.lo
+@@ -407,7 +407,7 @@ libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \
+ @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LDFLAGS = \
+ @PLUGIN_NVPTX_TRUE@ $(libgomp_plugin_nvptx_version_info) \
+ @PLUGIN_NVPTX_TRUE@ $(lt_host_flags) $(PLUGIN_NVPTX_LDFLAGS)
+-@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBADD = libgomp.la $(PLUGIN_NVPTX_LIBS)
++@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBADD = $(PLUGIN_NVPTX_LIBS)
+ @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBTOOLFLAGS = --tag=disable-static
+ libgomp_plugin_host_nonshm_version_info = -version-info $(libtool_VERSION)
+ libgomp_plugin_host_nonshm_la_SOURCES = plugin/plugin-host.c
+@@ -415,7 +415,6 @@ libgomp_plugin_host_nonshm_la_CPPFLAGS = $(AM_CPPFLAGS) -DHOST_NONSHM_PLUGIN
+ libgomp_plugin_host_nonshm_la_LDFLAGS = \
+ $(libgomp_plugin_host_nonshm_version_info) $(lt_host_flags)
+
+-libgomp_plugin_host_nonshm_la_LIBADD = libgomp.la
+ libgomp_plugin_host_nonshm_la_LIBTOOLFLAGS = --tag=disable-static
+ nodist_noinst_HEADERS = libgomp_f.h
+ nodist_libsubinclude_HEADERS = omp.h openacc.h
+diff --git a/libgomp/plugin/Makefrag.am b/libgomp/plugin/Makefrag.am
+index 167485f..d2c5428 100644
+--- a/libgomp/plugin/Makefrag.am
++++ b/libgomp/plugin/Makefrag.am
+@@ -35,7 +35,7 @@ libgomp_plugin_nvptx_la_CPPFLAGS = $(AM_CPPFLAGS) $(PLUGIN_NVPTX_CPPFLAGS)
+ libgomp_plugin_nvptx_la_LDFLAGS = $(libgomp_plugin_nvptx_version_info) \
+ $(lt_host_flags)
+ libgomp_plugin_nvptx_la_LDFLAGS += $(PLUGIN_NVPTX_LDFLAGS)
+-libgomp_plugin_nvptx_la_LIBADD = libgomp.la $(PLUGIN_NVPTX_LIBS)
++libgomp_plugin_nvptx_la_LIBADD = $(PLUGIN_NVPTX_LIBS)
+ libgomp_plugin_nvptx_la_LIBTOOLFLAGS = --tag=disable-static
+ endif
+
+@@ -45,5 +45,4 @@ libgomp_plugin_host_nonshm_la_SOURCES = plugin/plugin-host.c
+ libgomp_plugin_host_nonshm_la_CPPFLAGS = $(AM_CPPFLAGS) -DHOST_NONSHM_PLUGIN
+ libgomp_plugin_host_nonshm_la_LDFLAGS = \
+ $(libgomp_plugin_host_nonshm_version_info) $(lt_host_flags)
+-libgomp_plugin_host_nonshm_la_LIBADD = libgomp.la
+ libgomp_plugin_host_nonshm_la_LIBTOOLFLAGS = --tag=disable-static
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
new file mode 100644
index 000000000..41c0294da
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
@@ -0,0 +1,27 @@
+From b0b0688176a9482777e9b2e98408bfc4505d31af Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Apr 2015 23:15:27 -0700
+Subject: [PATCH 36/46] Use SYSTEMLIBS_DIR replacement instead of hardcoding
+ base_libdir
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/aarch64/aarch64-linux.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
+index 257acf0..abeb948 100644
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -21,7 +21,7 @@
+ #ifndef GCC_AARCH64_LINUX_H
+ #define GCC_AARCH64_LINUX_H
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+
+ #undef ASAN_CC1_SPEC
+ #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0037-aarch64-Add-support-for-musl-ldso.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0037-aarch64-Add-support-for-musl-ldso.patch
new file mode 100644
index 000000000..30dbe74ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0037-aarch64-Add-support-for-musl-ldso.patch
@@ -0,0 +1,26 @@
+From 420ca64a86d560a77ee596a9774d672b08ca8278 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Apr 2015 23:18:39 -0700
+Subject: [PATCH 37/46] aarch64: Add support for musl ldso
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/aarch64/aarch64-linux.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
+index abeb948..f9e65fc 100644
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -23,6 +23,8 @@
+
+ #define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+
++#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-aarch64.so.1"
++
+ #undef ASAN_CC1_SPEC
+ #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
+
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0038-fix-g-sysroot.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0038-fix-g-sysroot.patch
new file mode 100644
index 000000000..9ba574a5c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0038-fix-g-sysroot.patch
@@ -0,0 +1,56 @@
+From 8df3e7007a22c9d6be5d5ae4b9b169c5c8431917 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 27 May 2015 17:06:06 -0700
+Subject: [PATCH 38/46] fix g++ sysroot
+
+Portions of
+
+http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg26013.html
+
+are not upstreamed yet. So lets keep missing pieces.
+
+Upstream-Status: Pending
+
+Without this, compiling something simple like #include <limits> on target
+with c++ test.cpp fails unable to find the header. strace shows it looking in
+usr/include/xxxx rather than /usr/include/xxxx
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/configure | 4 +++-
+ gcc/configure.ac | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 9b60aad..6df594c 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -3375,7 +3375,9 @@ gcc_gxx_include_dir_add_sysroot=0
+ if test "${with_sysroot+set}" = set; then
+ gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+ if test "${gcc_gxx_without_sysroot}"; then
+- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ if test x${with_sysroot} != x/; then
++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ fi
+ gcc_gxx_include_dir_add_sysroot=1
+ fi
+ fi
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index e1e54f2..3bb2173 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -152,7 +152,9 @@ gcc_gxx_include_dir_add_sysroot=0
+ if test "${with_sysroot+set}" = set; then
+ gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+ if test "${gcc_gxx_without_sysroot}"; then
+- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ if test x${with_sysroot} != x/; then
++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++ fi
+ gcc_gxx_include_dir_add_sysroot=1
+ fi
+ fi
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch
new file mode 100644
index 000000000..2e0df968b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch
@@ -0,0 +1,54 @@
+From 1eede9e4a10d3532db826a6eeced695df3ad5b89 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 5 Jul 2015 20:25:18 -0700
+Subject: [PATCH 39/46] libcc1: fix libcc1's install path and rpath
+
+* Install libcc1.so and libcc1plugin.so into
+ $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version), as what we
+ had done to lto-plugin.
+* Fix bad RPATH iussue:
+ gcc-5.2.0: package gcc-plugins contains bad RPATH /patht/to/tmp/sysroots/qemux86-64/usr/lib64/../lib64 in file
+ /path/to/gcc/5.2.0-r0/packages-split/gcc-plugins/usr/lib64/gcc/x86_64-poky-linux/5.2.0/plugin/libcc1plugin.so.0.0.0
+ [rpaths]
+
+Upstream-Status: Inappropriate [OE configuration]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ libcc1/Makefile.am | 4 ++--
+ libcc1/Makefile.in | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libcc1/Makefile.am b/libcc1/Makefile.am
+index 7a274b3..db69bea 100644
+--- a/libcc1/Makefile.am
++++ b/libcc1/Makefile.am
+@@ -35,8 +35,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
+ $(Wc)$(libiberty_normal)))
+ libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
+
+-plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
+-cc1libdir = $(libdir)/$(libsuffix)
++cc1libdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
++plugindir = $(cc1libdir)
+
+ if ENABLE_PLUGIN
+ plugin_LTLIBRARIES = libcc1plugin.la
+diff --git a/libcc1/Makefile.in b/libcc1/Makefile.in
+index 1916134..c8995d2 100644
+--- a/libcc1/Makefile.in
++++ b/libcc1/Makefile.in
+@@ -262,8 +262,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
+ $(Wc)$(libiberty_normal)))
+
+ libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
+-plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
+-cc1libdir = $(libdir)/$(libsuffix)
++cc1libdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
++plugindir = $(cc1libdir)
+ @ENABLE_PLUGIN_TRUE@plugin_LTLIBRARIES = libcc1plugin.la
+ @ENABLE_PLUGIN_TRUE@cc1lib_LTLIBRARIES = libcc1.la
+ BUILT_SOURCES = compiler-name.h
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0040-handle-sysroot-support-for-nativesdk-gcc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0040-handle-sysroot-support-for-nativesdk-gcc.patch
new file mode 100644
index 000000000..11e1310f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0040-handle-sysroot-support-for-nativesdk-gcc.patch
@@ -0,0 +1,213 @@
+From b41674d357c4ba320b9860e0f313d2f5a332f27d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Dec 2015 23:39:54 +0000
+Subject: [PATCH 40/46] handle sysroot support for nativesdk-gcc
+
+Being able to build a nativesdk gcc is useful, particularly in cases
+where the host compiler may be of an incompatible version (or a 32
+bit compiler is needed).
+
+Sadly, building nativesdk-gcc is not straight forward. We install
+nativesdk-gcc into a relocatable location and this means that its
+library locations can change. "Normal" sysroot support doesn't help
+in this case since the values of paths like "libdir" change, not just
+base root directory of the system.
+
+In order to handle this we do two things:
+
+a) Add %r into spec file markup which can be used for injected paths
+ such as SYSTEMLIBS_DIR (see gcc_multilib_setup()).
+b) Add other paths which need relocation into a .gccrelocprefix section
+ which the relocation code will notice and adjust automatically.
+
+Upstream-Status: Inappropriate
+RP 2015/7/28
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/cppdefault.c | 50 +++++++++++++++++++++++++++++++++++++-------------
+ gcc/cppdefault.h | 3 ++-
+ gcc/gcc.c | 20 ++++++++++++++------
+ 3 files changed, 53 insertions(+), 20 deletions(-)
+
+diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
+index 03a0287..f44c1d8 100644
+--- a/gcc/cppdefault.c
++++ b/gcc/cppdefault.c
+@@ -35,6 +35,30 @@
+ # undef CROSS_INCLUDE_DIR
+ #endif
+
++static char GPLUSPLUS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_INCLUDE_DIR;
++static char GCC_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GCC_INCLUDE_DIR;
++static char GPLUSPLUS_TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_TOOL_INCLUDE_DIR;
++static char GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_BACKWARD_INCLUDE_DIR;
++static char STANDARD_STARTFILE_PREFIX_2VAR[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET;
++#ifdef LOCAL_INCLUDE_DIR
++static char LOCAL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = LOCAL_INCLUDE_DIR;
++#endif
++#ifdef PREFIX_INCLUDE_DIR
++static char PREFIX_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = PREFIX_INCLUDE_DIR;
++#endif
++#ifdef FIXED_INCLUDE_DIR
++static char FIXED_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = FIXED_INCLUDE_DIR;
++#endif
++#ifdef CROSS_INCLUDE_DIR
++static char CROSS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = CROSS_INCLUDE_DIR;
++#endif
++#ifdef TOOL_INCLUDE_DIR
++static char TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = TOOL_INCLUDE_DIR;
++#endif
++#ifdef NATIVE_SYSTEM_HEADER_DIR
++static char NATIVE_SYSTEM_HEADER_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = NATIVE_SYSTEM_HEADER_DIR;
++#endif
++
+ const struct default_include cpp_include_defaults[]
+ #ifdef INCLUDE_DEFAULTS
+ = INCLUDE_DEFAULTS;
+@@ -42,38 +66,38 @@ const struct default_include cpp_include_defaults[]
+ = {
+ #ifdef GPLUSPLUS_INCLUDE_DIR
+ /* Pick up GNU C++ generic include files. */
+- { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1,
++ { GPLUSPLUS_INCLUDE_DIRVAR, "G++", 1, 1,
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
+ #endif
+ #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
+ /* Pick up GNU C++ target-dependent include files. */
+- { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1,
++ { GPLUSPLUS_TOOL_INCLUDE_DIRVAR, "G++", 1, 1,
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 },
+ #endif
+ #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
+ /* Pick up GNU C++ backward and deprecated include files. */
+- { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1,
++ { GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR, "G++", 1, 1,
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
+ #endif
+ #ifdef GCC_INCLUDE_DIR
+ /* This is the dir for gcc's private headers. */
+- { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
++ { GCC_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 },
+ #endif
+ #ifdef GCC_INCLUDE_SUBDIR_TARGET
+ /* This is the dir for gcc's private headers under the specified sysroot. */
+- { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
++ { STANDARD_STARTFILE_PREFIX_2VAR, "GCC", 0, 0, 1, 0 },
+ #endif
+ #ifdef LOCAL_INCLUDE_DIR
+ /* /usr/local/include comes before the fixincluded header files. */
+- { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+- { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
++ { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 2 },
++ { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 0 },
+ #endif
+ #ifdef PREFIX_INCLUDE_DIR
+- { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0 },
++ { PREFIX_INCLUDE_DIRVAR, 0, 0, 1, 0, 0 },
+ #endif
+ #ifdef FIXED_INCLUDE_DIR
+ /* This is the dir for fixincludes. */
+- { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0,
++ { FIXED_INCLUDE_DIRVAR, "GCC", 0, 0, 0,
+ /* A multilib suffix needs adding if different multilibs use
+ different headers. */
+ #ifdef SYSROOT_HEADERS_SUFFIX_SPEC
+@@ -85,16 +109,16 @@ const struct default_include cpp_include_defaults[]
+ #endif
+ #ifdef CROSS_INCLUDE_DIR
+ /* One place the target system's headers might be. */
+- { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
++ { CROSS_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 },
+ #endif
+ #ifdef TOOL_INCLUDE_DIR
+ /* Another place the target system's headers might be. */
+- { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 },
++ { TOOL_INCLUDE_DIRVAR, "BINUTILS", 0, 1, 0, 0 },
+ #endif
+ #ifdef NATIVE_SYSTEM_HEADER_DIR
+ /* /usr/include comes dead last. */
+- { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
+- { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
++ { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
++ { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
+ #endif
+ { 0, 0, 0, 0, 0, 0 }
+ };
+diff --git a/gcc/cppdefault.h b/gcc/cppdefault.h
+index c98644f..4198669 100644
+--- a/gcc/cppdefault.h
++++ b/gcc/cppdefault.h
+@@ -33,7 +33,8 @@
+
+ struct default_include
+ {
+- const char *const fname; /* The name of the directory. */
++ const char *fname; /* The name of the directory. */
++
+ const char *const component; /* The component containing the directory
+ (see update_path in prefix.c) */
+ const char cplusplus; /* Only look here if we're compiling C++. */
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 3ca27b9..2b7756e 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -120,6 +120,8 @@ static const char *target_system_root = TARGET_SYSTEM_ROOT;
+ #else
+ static const char *target_system_root = 0;
+ #endif
++
++static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
+
+ /* Nonzero means pass the updated target_system_root to the compiler. */
+
+@@ -390,6 +392,7 @@ or with constant text in a single argument.
+ %G process LIBGCC_SPEC as a spec.
+ %R Output the concatenation of target_system_root and
+ target_sysroot_suffix.
++ %r Output the base path target_relocatable_prefix
+ %S process STARTFILE_SPEC as a spec. A capital S is actually used here.
+ %E process ENDFILE_SPEC as a spec. A capital E is actually used here.
+ %C process CPP_SPEC as a spec.
+@@ -1286,10 +1289,10 @@ static const char *gcc_libexec_prefix;
+ gcc_exec_prefix is set because, in that case, we know where the
+ compiler has been installed, and use paths relative to that
+ location instead. */
+-static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
+-static const char *const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX;
+-static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
+-static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
++static char standard_exec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_EXEC_PREFIX;
++static char standard_libexec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_LIBEXEC_PREFIX;
++static char standard_bindir_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_BINDIR_PREFIX;
++static char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
+
+ /* For native compilers, these are well-known paths containing
+ components that may be provided by the system. For cross
+@@ -1297,9 +1300,9 @@ static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
+ static const char *md_exec_prefix = MD_EXEC_PREFIX;
+ static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
+ static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
+-static const char *const standard_startfile_prefix_1
++static char standard_startfile_prefix_1[4096] __attribute__ ((section (".gccrelocprefix")))
+ = STANDARD_STARTFILE_PREFIX_1;
+-static const char *const standard_startfile_prefix_2
++static char standard_startfile_prefix_2[4096] __attribute__ ((section (".gccrelocprefix")))
+ = STANDARD_STARTFILE_PREFIX_2;
+
+ /* A relative path to be used in finding the location of tools
+@@ -5523,6 +5526,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
+ }
+ break;
+
++ case 'r':
++ obstack_grow (&obstack, target_relocatable_prefix,
++ strlen (target_relocatable_prefix));
++ break;
++
+ case 'S':
+ value = do_spec_1 (startfile_spec, 0, NULL);
+ if (value != 0)
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0041-Search-target-sysroot-gcc-version-specific-dirs-with.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0041-Search-target-sysroot-gcc-version-specific-dirs-with.patch
new file mode 100644
index 000000000..5a504a1f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0041-Search-target-sysroot-gcc-version-specific-dirs-with.patch
@@ -0,0 +1,102 @@
+From 99cadb4d8415dd5a275d7d6410f20db33d0f8433 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Dec 2015 23:41:45 +0000
+Subject: [PATCH 41/46] Search target sysroot gcc version specific dirs with
+ multilib.
+
+We install the gcc libraries (such as crtbegin.p) into
+<sysroot><libdir>/<target-sys>/5.2.0/
+which is a default search path for GCC (aka multi_suffix in the
+code below). <target-sys> is 'machine' in gcc's terminology. We use
+these directories so that multiple gcc versions could in theory
+co-exist on target.
+
+We only want to build one gcc-cross-canadian per arch and have this work
+for all multilibs. <target-sys> can be handled by mapping the multilib
+<target-sys> to the one used by gcc-cross-canadian, e.g.
+mips64-polkmllib32-linux
+is symlinked to by mips64-poky-linux.
+
+The default gcc search path in the target sysroot for a "lib64" mutlilib
+is:
+
+<sysroot>/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/../lib64/
+<sysroot>/usr/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/../lib64/
+<sysroot>/lib32/
+<sysroot>/usr/lib32/
+
+which means that the lib32 crtbegin.o will be found and the lib64 ones
+will not which leads to compiler failures.
+
+This patch injects a multilib version of that path first so the lib64
+binaries can be found first. With this change the search path becomes:
+
+<sysroot>/lib32/../lib64/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/../lib64/
+<sysroot>/usr/lib32/../lib64/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/../lib64/
+<sysroot>/lib32/
+<sysroot>/usr/lib32/
+
+Upstream-Status: Pending
+RP 2015/7/31
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/gcc.c | 29 ++++++++++++++++++++++++++++-
+ 1 file changed, 28 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 2b7756e..8f53aea 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -2305,7 +2305,7 @@ for_each_path (const struct path_prefix *paths,
+ if (path == NULL)
+ {
+ len = paths->max_len + extra_space + 1;
+- len += MAX (MAX (suffix_len, multi_os_dir_len), multiarch_len);
++ len += MAX ((suffix_len + multi_os_dir_len), multiarch_len);
+ path = XNEWVEC (char, len);
+ }
+
+@@ -2317,6 +2317,33 @@ for_each_path (const struct path_prefix *paths,
+ /* Look first in MACHINE/VERSION subdirectory. */
+ if (!skip_multi_dir)
+ {
++ if (!(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir))
++ {
++ const char *this_multi;
++ size_t this_multi_len;
++
++ if (pl->os_multilib)
++ {
++ this_multi = multi_os_dir;
++ this_multi_len = multi_os_dir_len;
++ }
++ else
++ {
++ this_multi = multi_dir;
++ this_multi_len = multi_dir_len;
++ }
++
++ /* Look in multilib MACHINE/VERSION subdirectory first */
++ if (this_multi_len)
++ {
++ memcpy (path + len, this_multi, this_multi_len + 1);
++ memcpy (path + len + this_multi_len, multi_suffix, suffix_len + 1);
++ ret = callback (path, callback_info);
++ if (ret)
++ break;
++ }
++ }
++
+ memcpy (path + len, multi_suffix, suffix_len + 1);
+ ret = callback (path, callback_info);
+ if (ret)
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0042-Fix-various-_FOR_BUILD-and-related-variables.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0042-Fix-various-_FOR_BUILD-and-related-variables.patch
new file mode 100644
index 000000000..5af764b7c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0042-Fix-various-_FOR_BUILD-and-related-variables.patch
@@ -0,0 +1,137 @@
+From 78e77206902349c9256f06c3dd179197a39af2e1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Dec 2015 23:42:45 +0000
+Subject: [PATCH 42/46] Fix various _FOR_BUILD and related variables
+
+When doing a FOR_BUILD thing, you have to override CFLAGS with
+CFLAGS_FOR_BUILD. And if you use C++, you also have to override
+CXXFLAGS with CXXFLAGS_FOR_BUILD.
+Without this, when building for mingw, you end up trying to use
+the mingw headers for a host build.
+
+The same goes for other variables as well, such as CPPFLAGS,
+CPP, and GMPINC.
+
+Upstream-Status: Pending
+
+Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.in | 6 ++++++
+ Makefile.tpl | 5 +++++
+ gcc/Makefile.in | 2 +-
+ gcc/configure | 2 +-
+ gcc/configure.ac | 2 +-
+ 5 files changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index a783e1e..8b6d3d2 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -152,6 +152,7 @@ BUILD_EXPORTS = \
+ CPP="$(CC_FOR_BUILD) -E"; export CPP; \
+ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
++ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_BUILD)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+@@ -170,6 +171,9 @@ BUILD_EXPORTS = \
+ # built for the build system to override those in BASE_FLAGS_TO_PASS.
+ EXTRA_BUILD_FLAGS = \
+ CFLAGS="$(CFLAGS_FOR_BUILD)" \
++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
++ CPP="$(CC_FOR_BUILD) -E" \
++ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \
+ LDFLAGS="$(LDFLAGS_FOR_BUILD)"
+
+ # This is the list of directories to built for the host system.
+@@ -187,6 +191,7 @@ HOST_SUBDIR = @host_subdir@
+ HOST_EXPORTS = \
+ $(BASE_EXPORTS) \
+ CC="$(CC)"; export CC; \
++ CPP="$(CC) -E"; export CPP; \
+ ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
+ CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+@@ -710,6 +715,7 @@ BASE_FLAGS_TO_PASS = \
+ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+ "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
+ "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
++ "CXXFLAGS_FOR_BUILD=$(CXXFLAGS_FOR_BUILD)" \
+ "EXPECT=$(EXPECT)" \
+ "FLEX=$(FLEX)" \
+ "INSTALL=$(INSTALL)" \
+diff --git a/Makefile.tpl b/Makefile.tpl
+index 1ea1954..78a59c3 100644
+--- a/Makefile.tpl
++++ b/Makefile.tpl
+@@ -154,6 +154,7 @@ BUILD_EXPORTS = \
+ CC="$(CC_FOR_BUILD)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
++ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_BUILD)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+@@ -172,6 +173,9 @@ BUILD_EXPORTS = \
+ # built for the build system to override those in BASE_FLAGS_TO_PASS.
+ EXTRA_BUILD_FLAGS = \
+ CFLAGS="$(CFLAGS_FOR_BUILD)" \
++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
++ CPP="$(CC_FOR_BUILD) -E" \
++ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \
+ LDFLAGS="$(LDFLAGS_FOR_BUILD)"
+
+ # This is the list of directories to built for the host system.
+@@ -189,6 +193,7 @@ HOST_SUBDIR = @host_subdir@
+ HOST_EXPORTS = \
+ $(BASE_EXPORTS) \
+ CC="$(CC)"; export CC; \
++ CPP="$(CC) -E"; export CPP; \
+ ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
+ CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index cd5bc4a..98ae4f4 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -762,7 +762,7 @@ BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS)
+ # Native linker and preprocessor flags. For x-fragment overrides.
+ BUILD_LDFLAGS=@BUILD_LDFLAGS@
+ BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
+- -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS)
++ -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS_FOR_BUILD)
+
+ # Actual name to use when installing a native compiler.
+ GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
+diff --git a/gcc/configure b/gcc/configure
+index 6df594c..fcb05e7 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11521,7 +11521,7 @@ else
+ CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+ CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \
+ LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \
+- GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \
++ GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \
+ ${realsrcdir}/configure \
+ --enable-languages=${enable_languages-all} \
+ --target=$target_alias --host=$build_alias --build=$build_alias
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 3bb2173..923bc9a 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1633,7 +1633,7 @@ else
+ CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+ CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \
+ LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \
+- GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \
++ GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \
+ ${realsrcdir}/configure \
+ --enable-languages=${enable_languages-all} \
+ --target=$target_alias --host=$build_alias --build=$build_alias
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0043-libstdc-Support-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0043-libstdc-Support-musl.patch
new file mode 100644
index 000000000..bad8402ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0043-libstdc-Support-musl.patch
@@ -0,0 +1,44 @@
+From df430b943a2df6b72054c808d4b93338a82562de Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Dec 2015 08:23:34 +0000
+Subject: [PATCH 43/46] libstdc++: Support musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libstdc++-v3/configure.host | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
+index 640199c..1756444 100644
+--- a/libstdc++-v3/configure.host
++++ b/libstdc++-v3/configure.host
+@@ -274,14 +274,24 @@ case "${host_os}" in
+ os_include_dir="os/bsd/freebsd"
+ ;;
+ gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
++ # check for musl by target
++ case "${host_os}" in
++ *-musl*)
++ os_include_dir="os/generic"
++ ;;
++ *)
+ if [ "$uclibc" = "yes" ]; then
+ os_include_dir="os/uclibc"
+ elif [ "$bionic" = "yes" ]; then
+ os_include_dir="os/bionic"
++ elif [ "$musl" = "yes" ]; then
++ os_include_dir="os/generic"
+ else
+ os_include_dir="os/gnu-linux"
+ fi
+ ;;
++ esac
++ ;;
+ hpux*)
+ os_include_dir="os/hpux"
+ ;;
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch
new file mode 100644
index 000000000..b91c02d0b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0044-Adding-mmusl-as-a-musl-libc-specifier-and-the-necess.patch
@@ -0,0 +1,270 @@
+From 0b54799d80fb859c7b142467e4d42c99db59df50 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Dec 2015 08:30:35 +0000
+Subject: [PATCH 44/46] Adding -mmusl as a musl libc specifier, and the
+ necessary hacks for it to know how to find musl's dynamic linker.
+
+Upstream-Status: Backport [partial]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config.gcc | 10 ++++-
+ gcc/config/linux.h | 100 +++++++++++++++++++++++++++++++++++++-----
+ gcc/config/linux.opt | 4 ++
+ gcc/config/rs6000/secureplt.h | 1 +
+ gcc/config/rs6000/sysv4.h | 5 +++
+ gcc/ginclude/stddef.h | 3 ++
+ 6 files changed, 110 insertions(+), 13 deletions(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index 3825bd5..39ce047 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -575,7 +575,7 @@ case ${target} in
+ esac
+
+ # Common C libraries.
+-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
++tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
+
+ # 32-bit x86 processors supported by --with-arch=. Each processor
+ # MUST be separated by exactly one space.
+@@ -720,6 +720,9 @@ case ${target} in
+ *-*-*uclibc*)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
+ ;;
++ *-*-*musl*)
++ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
++ ;;
+ *)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
+ ;;
+@@ -2420,6 +2423,11 @@ powerpc*-*-linux*)
+ powerpc*-*-linux*paired*)
+ tm_file="${tm_file} rs6000/750cl.h" ;;
+ esac
++ case ${target} in
++ *-linux*-musl*)
++ enable_secureplt=yes ;;
++ esac
++
+ if test x${enable_secureplt} = xyes; then
+ tm_file="rs6000/secureplt.h ${tm_file}"
+ fi
+diff --git a/gcc/config/linux.h b/gcc/config/linux.h
+index 22b9be5..ca9a17f 100644
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -32,10 +32,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
+ #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
+ #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
++#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
+ #else
+ #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
+ #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
+ #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
++#define OPTION_MUSL (linux_libc == LIBC_MUSL)
+ #endif
+
+ #define GNU_USER_TARGET_OS_CPP_BUILTINS() \
+@@ -53,18 +55,21 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ uClibc or Bionic is the default C library and whether
+ -muclibc or -mglibc or -mbionic has been passed to change the default. */
+
+-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
+- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
++#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
++ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
+
+ #if DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
+ #elif DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
+ #elif DEFAULT_LIBC == LIBC_BIONIC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif /* DEFAULT_LIBC */
+@@ -84,16 +89,16 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+
+ #define GNU_USER_DYNAMIC_LINKER \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
+- BIONIC_DYNAMIC_LINKER)
++ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+ #define GNU_USER_DYNAMIC_LINKER32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
+- BIONIC_DYNAMIC_LINKER32)
++ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
+- BIONIC_DYNAMIC_LINKER64)
++ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+ #define GNU_USER_DYNAMIC_LINKERX32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
+- BIONIC_DYNAMIC_LINKERX32)
++ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
+
+ /* Whether we have Bionic libc runtime */
+ #undef TARGET_HAS_BIONIC
+@@ -123,3 +128,74 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ # define TARGET_LIBC_HAS_FUNCTION linux_libc_has_function
+
+ #endif
++
++/* musl avoids problematic includes by rearranging the include directories.
++ * Unfortunately, this is mostly duplicated from cppdefault.c */
++#if DEFAULT_LIBC == LIBC_MUSL
++#define INCLUDE_DEFAULTS_MUSL_GPP \
++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
++
++#ifdef LOCAL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_LOCAL \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_LOCAL
++#endif
++
++#ifdef PREFIX_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_PREFIX \
++ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_PREFIX
++#endif
++
++#ifdef CROSS_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_CROSS \
++ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#ifdef TOOL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_TOOL \
++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_TOOL
++#endif
++
++#ifdef NATIVE_SYSTEM_HEADER_DIR
++#define INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_NATIVE
++#endif
++
++#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
++# undef INCLUDE_DEFAULTS_MUSL_LOCAL
++# define INCLUDE_DEFAULTS_MUSL_LOCAL
++# undef INCLUDE_DEFAULTS_MUSL_NATIVE
++# define INCLUDE_DEFAULTS_MUSL_NATIVE
++#else
++# undef INCLUDE_DEFAULTS_MUSL_CROSS
++# define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#undef INCLUDE_DEFAULTS
++#define INCLUDE_DEFAULTS \
++ { \
++ INCLUDE_DEFAULTS_MUSL_GPP \
++ INCLUDE_DEFAULTS_MUSL_PREFIX \
++ INCLUDE_DEFAULTS_MUSL_CROSS \
++ INCLUDE_DEFAULTS_MUSL_TOOL \
++ INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
++ { 0, 0, 0, 0, 0, 0 } \
++ }
++#endif
+diff --git a/gcc/config/linux.opt b/gcc/config/linux.opt
+index c054338..9334f74 100644
+--- a/gcc/config/linux.opt
++++ b/gcc/config/linux.opt
+@@ -30,3 +30,7 @@ Use GNU C library
+ muclibc
+ Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
+ Use uClibc C library
++
++mmusl
++Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
++Use musl C library
+diff --git a/gcc/config/rs6000/secureplt.h b/gcc/config/rs6000/secureplt.h
+index b463463..77edf2a 100644
+--- a/gcc/config/rs6000/secureplt.h
++++ b/gcc/config/rs6000/secureplt.h
+@@ -18,3 +18,4 @@ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
++#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
+diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
+index c6c31dc..7cd07e0 100644
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -538,6 +538,10 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
+ #define CC1_SECURE_PLT_DEFAULT_SPEC ""
+ #endif
+
++#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
++#define LINK_SECURE_PLT_DEFAULT_SPEC ""
++#endif
++
+ /* Pass -G xxx to the compiler. */
+ #undef CC1_SPEC
+ #define CC1_SPEC "%{G*} %(cc1_cpu)" \
+@@ -889,6 +893,7 @@ ncrtn.o%s"
+ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
+ { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
+ { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
++ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
+ { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
+ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
+ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
+diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
+index f20a41b..eb879ef 100644
+--- a/gcc/ginclude/stddef.h
++++ b/gcc/ginclude/stddef.h
+@@ -184,6 +184,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 +201,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__)
+@@ -218,6 +220,7 @@ typedef __SIZE_TYPE__ size_t;
+ typedef long ssize_t;
+ #endif /* __BEOS__ */
+ #endif /* !(defined (__GNUG__) && defined (size_t)) */
++#endif /* __DEFINED_size_t */
+ #endif /* __size_t */
+ #endif /* _SIZET_ */
+ #endif /* _GCC_SIZE_T */
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0045-Support-for-arm-linux-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0045-Support-for-arm-linux-musl.patch
new file mode 100644
index 000000000..3c1115aa8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0045-Support-for-arm-linux-musl.patch
@@ -0,0 +1,216 @@
+From a6c649571d49c972e6d207577780ada7e9b6bad5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Dec 2015 08:31:52 +0000
+Subject: [PATCH 45/57] Support for arm-linux-musl.
+
+Fix musl ldso for all arches
+
+Upstream-Status: backport [partial]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/aarch64/aarch64-linux.h | 1 +
+ gcc/config/arm/linux-eabi.h | 17 +++++++++++++++++
+ gcc/config/i386/linux.h | 1 +
+ gcc/config/i386/linux64.h | 5 +++++
+ gcc/config/mips/linux.h | 8 +++++++-
+ gcc/config/rs6000/linux64.h | 13 +++++++++----
+ gcc/config/rs6000/sysv4.h | 10 +++++++---
+ libitm/config/arm/hwcap.cc | 4 ++++
+ libitm/config/linux/x86/tls.h | 8 ++++++--
+ 9 files changed, 57 insertions(+), 10 deletions(-)
+
+diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
+index f9e65fc..1b2d0c0 100644
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -22,6 +22,7 @@
+ #define GCC_AARCH64_LINUX_H
+
+ #define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
++#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-aarch64.so.1"
+
+ #define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-aarch64.so.1"
+
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index 048a062..adb9c44 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -81,6 +81,23 @@
+ #undef TARGET_FIX_V4BX_SPEC
+ #define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}"
+
++/* For ARM musl currently supports four dynamic linkers:
++ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
++ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
++ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
++ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
++ musl does not support the legacy OABI mode.
++ All the dynamic linkers live in /lib.
++ We default to soft-float, EL. */
++#undef MUSL_DYNAMIC_LINKER
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
++#else
++#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
++#endif
++#define MUSL_DYNAMIC_LINKER \
++ SYSTEMLIBS_DIR "ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
++
+ /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
+ use the GNU/Linux version, not the generic BPABI version. */
+ #undef LINK_SPEC
+diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
+index 21ba2b2..e2b81e5 100644
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -21,3 +21,4 @@ along with GCC; see the file COPYING3. If not see
+
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+ #define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
++#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-i386.so.1"
+diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
+index 6185cce..5a3a977 100644
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -30,3 +30,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
+ #define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2"
+ #define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2"
++
++#define MUSL_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-musl-i386.so.1"
++#define MUSL_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-musl-x86_64.so.1"
++#define MUSL_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-musl-x32.so.1"
++
+diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
+index c306afb..b899388 100644
+--- a/gcc/config/mips/linux.h
++++ b/gcc/config/mips/linux.h
+@@ -21,6 +21,12 @@ along with GCC; see the file COPYING3. If not see
+ #define GNU_USER_LINK_EMULATION64 "elf64%{EB:b}%{EL:l}tsmip"
+ #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
+
++#undef MUSL_DYNAMIC_LINKER32
++#define MUSL_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-musl-mips%{EL:el}%{msoft-float:-sf}.so.1"
++#undef MUSL_DYNAMIC_LINKER64
++#define MUSL_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-musl-mips64%{EL:el}%{msoft-float:-sf}.so.1"
++#define MUSL_DYNAMIC_LINKERN32 SYSTEMLIBS_DIR "ld-musl-mipsn32%{EL:el}%{msoft-float:-sf}.so.1"
++
+ #define GLIBC_DYNAMIC_LINKER32 \
+ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ #define GLIBC_DYNAMIC_LINKER64 \
+@@ -40,4 +46,4 @@ along with GCC; see the file COPYING3. If not see
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
+- BIONIC_DYNAMIC_LINKERN32)
++ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
+diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
+index 31c4338..679da4b 100644
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -365,17 +365,22 @@ extern int dot_symbols;
+ #endif
+ #define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
+ #define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
++#define MUSL_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-musl-powerpc.so.1"
++#define MUSL_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-musl-powerpc64.so.1"
++
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER32 \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64 \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+
+ #undef DEFAULT_ASM_ENDIAN
+ #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
+diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
+index 7cd07e0..8794fa5 100644
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -763,15 +763,19 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+ #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
++
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+
+ #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+diff --git a/libitm/config/arm/hwcap.cc b/libitm/config/arm/hwcap.cc
+index a1c2cfd..dd4fad2 100644
+--- a/libitm/config/arm/hwcap.cc
++++ b/libitm/config/arm/hwcap.cc
+@@ -40,7 +40,11 @@ int GTM_hwcap HIDDEN = 0
+
+ #ifdef __linux__
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <sys/fcntl.h>
++#else
++#include <fcntl.h>
++#endif
+ #include <elf.h>
+
+ static void __attribute__((constructor))
+diff --git a/libitm/config/linux/x86/tls.h b/libitm/config/linux/x86/tls.h
+index e731ab7..54ad8b6 100644
+--- a/libitm/config/linux/x86/tls.h
++++ b/libitm/config/linux/x86/tls.h
+@@ -25,16 +25,19 @@
+ #ifndef LIBITM_X86_TLS_H
+ #define LIBITM_X86_TLS_H 1
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ /* Use slots in the TCB head rather than __thread lookups.
+ GLIBC has reserved words 10 through 13 for TM. */
+ #define HAVE_ARCH_GTM_THREAD 1
+ #define HAVE_ARCH_GTM_THREAD_DISP 1
+ #endif
++#endif
+
+ #include "config/generic/tls.h"
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ namespace GTM HIDDEN {
+
+ #ifdef __x86_64__
+@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct abi_dispatch *x)
+
+ } // namespace GTM
+ #endif /* >= GLIBC 2.10 */
++#endif
+
+ #endif // LIBITM_X86_TLS_H
+--
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch
new file mode 100644
index 000000000..ddb0fc4f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0046-Get-rid-of-ever-broken-fixincludes-on-musl.patch
@@ -0,0 +1,28 @@
+From 047116e8c9cbb340264f4f28db3f21a68ba57ff3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Dec 2015 08:32:24 +0000
+Subject: [PATCH 46/46] Get rid of ever-broken fixincludes on musl.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ fixincludes/mkfixinc.sh | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/fixincludes/mkfixinc.sh b/fixincludes/mkfixinc.sh
+index 6653fedb..0d96c8c 100755
+--- a/fixincludes/mkfixinc.sh
++++ b/fixincludes/mkfixinc.sh
+@@ -19,7 +19,8 @@ case $machine in
+ powerpc-*-eabi* | \
+ powerpc-*-rtems* | \
+ powerpcle-*-eabisim* | \
+- powerpcle-*-eabi* )
++ powerpcle-*-eabi* | \
++ *-musl* )
+ # IF there is no include fixing,
+ # THEN create a no-op fixer and exit
+ (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
+--
+2.6.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0047-nios2-Define-MUSL_DYNAMIC_LINKER.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0047-nios2-Define-MUSL_DYNAMIC_LINKER.patch
new file mode 100644
index 000000000..a1cfb9c7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0047-nios2-Define-MUSL_DYNAMIC_LINKER.patch
@@ -0,0 +1,28 @@
+From f5ca07132b9292d2045ca7204e9cbfde2e59d0bf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 2 Feb 2016 10:26:10 -0800
+Subject: [PATCH 47/48] nios2: Define MUSL_DYNAMIC_LINKER
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ gcc/config/nios2/linux.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gcc/config/nios2/linux.h b/gcc/config/nios2/linux.h
+index f43f655..5587ab3 100644
+--- a/gcc/config/nios2/linux.h
++++ b/gcc/config/nios2/linux.h
+@@ -30,6 +30,7 @@
+ #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-nios2.so.1"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-nios2.so.1"
+
+ #undef LINK_SPEC
+ #define LINK_SPEC LINK_SPEC_ENDIAN \
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0048-ssp_nonshared.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0048-ssp_nonshared.patch
new file mode 100644
index 000000000..5ddd40a4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0048-ssp_nonshared.patch
@@ -0,0 +1,29 @@
+From 3cb6013cf287ed9b1247ea37541e64b9810a121d Mon Sep 17 00:00:00 2001
+From: Szabolcs Nagy <nsz@port70.net>
+Date: Sat, 7 Nov 2015 14:58:40 +0000
+Subject: [PATCH 48/48] ssp_nonshared
+
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+ gcc/gcc.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 8f53aea..3ddc658 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -732,7 +732,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.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0049-Disable-the-weak-reference-logic-in-gthr.h-for-os-ge.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0049-Disable-the-weak-reference-logic-in-gthr.h-for-os-ge.patch
new file mode 100644
index 000000000..0ea5143e0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0049-Disable-the-weak-reference-logic-in-gthr.h-for-os-ge.patch
@@ -0,0 +1,78 @@
+From 553d8e3b9073ff3e0a9d2fac9b1823fb17ad247c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 2 Feb 2016 21:00:18 -0800
+Subject: [PATCH 49/51] Disable the weak reference logic in gthr.h for
+ os/generic
+
+It does not work unless work arounds are there in gthr-posix.h
+
+origin of patch
+http://port70.net/~nsz/musl/gcc-5.3.0/0004-gthr.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ libgfortran/acinclude.m4 | 2 +-
+ libgfortran/configure | 2 +-
+ libstdc++-v3/config/os/generic/os_defines.h | 5 +++++
+ libstdc++-v3/configure.host | 3 +++
+ 4 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
+index ba890f9..30b8b1a6 100644
+--- a/libgfortran/acinclude.m4
++++ b/libgfortran/acinclude.m4
+@@ -100,7 +100,7 @@ void foo (void);
+ [Define to 1 if the target supports #pragma weak])
+ fi
+ case "$host" in
+- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
++ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
+ AC_DEFINE(GTHREAD_USE_WEAK, 0,
+ [Define to 0 if the target shouldn't use #pragma weak])
+ ;;
+diff --git a/libgfortran/configure b/libgfortran/configure
+index 5d47e65..cdf9695 100755
+--- a/libgfortran/configure
++++ b/libgfortran/configure
+@@ -26456,7 +26456,7 @@ $as_echo "#define SUPPORTS_WEAK 1" >>confdefs.h
+
+ fi
+ case "$host" in
+- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
++ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
+
+ $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
+
+diff --git a/libstdc++-v3/config/os/generic/os_defines.h b/libstdc++-v3/config/os/generic/os_defines.h
+index 45bf52a..103ec0e 100644
+--- a/libstdc++-v3/config/os/generic/os_defines.h
++++ b/libstdc++-v3/config/os/generic/os_defines.h
+@@ -33,4 +33,9 @@
+ // System-specific #define, typedefs, corrections, etc, go here. This
+ // file will come before all others.
+
++// Disable the weak reference logic in gthr.h for os/generic because it
++// is broken on every platform unless there is implementation specific
++// workaround in gthr-posix.h and at link-time for static linking.
++#define _GLIBCXX_GTHREAD_USE_WEAK 0
++
+ #endif
+diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
+index 1756444..2a87bb8 100644
+--- a/libstdc++-v3/configure.host
++++ b/libstdc++-v3/configure.host
+@@ -273,6 +273,9 @@ case "${host_os}" in
+ freebsd*)
+ os_include_dir="os/bsd/freebsd"
+ ;;
++ linux-musl*)
++ os_include_dir="os/generic"
++ ;;
+ gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+ # check for musl by target
+ case "${host_os}" in
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0050-powerpc-pass-secure-plt-to-the-linker.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0050-powerpc-pass-secure-plt-to-the-linker.patch
new file mode 100644
index 000000000..b2f2bbdf4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0050-powerpc-pass-secure-plt-to-the-linker.patch
@@ -0,0 +1,66 @@
+From 4fa0cf03678f849917dcc3d149989b7fecdbe276 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 2 Feb 2016 21:10:00 -0800
+Subject: [PATCH 50/51] powerpc pass --secure-plt to the linker
+
+Secure-plt when enabled does not pass right options to linker
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+ gcc/config/rs6000/linux64.h | 4 ++++
+ gcc/config/rs6000/sysv4.h | 2 ++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
+index 679da4b..3ca7cd7 100644
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -174,20 +174,24 @@ extern int dot_symbols;
+ #undef ASM_DEFAULT_SPEC
+ #undef ASM_SPEC
+ #undef LINK_OS_LINUX_SPEC
++#undef LINK_SECURE_PLT_SPEC
+
+ #ifndef RS6000_BI_ARCH
+ #define ASM_DEFAULT_SPEC "-mppc64"
+ #define ASM_SPEC "%(asm_spec64) %(asm_spec_common)"
+ #define LINK_OS_LINUX_SPEC "%(link_os_linux_spec64)"
++#define LINK_SECURE_PLT_SPEC ""
+ #else
+ #if DEFAULT_ARCH64_P
+ #define ASM_DEFAULT_SPEC "-mppc%{!m32:64}"
+ #define ASM_SPEC "%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)"
+ #define LINK_OS_LINUX_SPEC "%{m32:%(link_os_linux_spec32)}%{!m32:%(link_os_linux_spec64)}"
++#define LINK_SECURE_PLT_SPEC "%{m32: " LINK_SECURE_PLT_DEFAULT_SPEC "}"
+ #else
+ #define ASM_DEFAULT_SPEC "-mppc%{m64:64}"
+ #define ASM_SPEC "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)"
+ #define LINK_OS_LINUX_SPEC "%{!m64:%(link_os_linux_spec32)}%{m64:%(link_os_linux_spec64)}"
++#define LINK_SECURE_PLT_SPEC "%{!m64: " LINK_SECURE_PLT_DEFAULT_SPEC "}"
+ #endif
+ #endif
+
+diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
+index 8794fa5..0835551 100644
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -571,6 +571,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
+ : %(link_start_default) }"
+
+ #define LINK_START_DEFAULT_SPEC ""
++#define LINK_SECURE_PLT_SPEC LINK_SECURE_PLT_DEFAULT_SPEC
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "\
+@@ -578,6 +579,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
+ %{R*} \
+ %(link_shlib) \
+ %{!T*: %(link_start) } \
++%{!static: %{!mbss-plt: %(link_secure_plt_default)}} \
+ %(link_os)"
+
+ /* Shared libraries are not default. */
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
new file mode 100644
index 000000000..e8f79b590
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
@@ -0,0 +1,31 @@
+From 32593b38082ea65f4c82159254adf1e0dc2423be Mon Sep 17 00:00:00 2001
+From: bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 16 Feb 2016 03:15:15 -0500
+Subject: [PATCH] Ignore -fdebug-prefix-map in producer string (by Daniel Kahn
+ Gillmor)
+
+* dwarf2out.c (gen_producer_string): Ignore -fdebug-prefix-map.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231835 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/dwarf2out.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index 3614c10..526f114 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19670,6 +19670,7 @@ gen_producer_string (void)
+ case OPT_fpreprocessed:
+ case OPT_fltrans_output_list_:
+ case OPT_fresolution_:
++ case OPT_fdebug_prefix_map_:
+ /* Ignore these. */
+ continue;
+ default:
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0052-nios2-use-ret-with-r31.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0052-nios2-use-ret-with-r31.patch
new file mode 100644
index 000000000..f3cb47fd1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0052-nios2-use-ret-with-r31.patch
@@ -0,0 +1,103 @@
+From 1d67120d95c2c6e0ed4f7357d1cc62887eaba463 Mon Sep 17 00:00:00 2001
+From: sandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 12 May 2015 15:57:22 +0000
+Subject: [PATCH] 2015-05-12 Chung-Lin Tang <cltang@codesourcery.com>
+ Sandra Loosemore <sandra@codesourcery.com>
+
+ gcc/
+ * config/nios2/nios2.h (enum reg_class): Add IJMP_REGS enum
+ value.
+ (REG_CLASS_NAMES): Add "IJMP_REGS".
+ (REG_CLASS_CONTENTS): Add new entry for IJMP_REGS.
+ * config/nios2/nios2.md (indirect_jump,*tablejump): Adjust to
+ use new "c" register constraint.
+ * config/nios2/constraint.md (c): New register constraint
+ corresponding to IJMP_REGS.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223082 138bc75d-0d04-0410-961f-82ee72b054a4
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Backport [ git://gcc.gnu.org/git/gcc.git 1d67120d95c2c6e0ed4f7357d1cc62887eaba463 ]
+---
+ gcc/ChangeLog | 12 ++++++++++++
+ gcc/config/nios2/constraints.md | 3 +++
+ gcc/config/nios2/nios2.h | 11 +++++++----
+ gcc/config/nios2/nios2.md | 4 ++--
+ 4 files changed, 24 insertions(+), 6 deletions(-)
+
+diff --git a/gcc/config/nios2/constraints.md b/gcc/config/nios2/constraints.md
+index f4bd9f7..735f892 100644
+--- a/gcc/config/nios2/constraints.md
++++ b/gcc/config/nios2/constraints.md
+@@ -39,6 +39,9 @@
+
+ ;; Register constraints
+
++(define_register_constraint "c" "IJMP_REGS"
++ "A register suitable for an indirect jump.")
++
+ (define_register_constraint "j" "SIB_REGS"
+ "A register suitable for an indirect sibcall.")
+
+diff --git a/gcc/config/nios2/nios2.h b/gcc/config/nios2/nios2.h
+index 510ab5f..ac33978 100644
+--- a/gcc/config/nios2/nios2.h
++++ b/gcc/config/nios2/nios2.h
+@@ -173,6 +173,7 @@ enum reg_class
+ {
+ NO_REGS,
+ SIB_REGS,
++ IJMP_REGS,
+ GP_REGS,
+ ALL_REGS,
+ LIM_REG_CLASSES
+@@ -183,6 +184,7 @@ enum reg_class
+ #define REG_CLASS_NAMES \
+ { "NO_REGS", \
+ "SIB_REGS", \
++ "IJMP_REGS", \
+ "GP_REGS", \
+ "ALL_REGS" }
+
+@@ -190,10 +192,11 @@ enum reg_class
+
+ #define REG_CLASS_CONTENTS \
+ { \
+- /* NO_REGS */ { 0, 0}, \
+- /* SIB_REGS */ { 0xfe0c, 0}, \
+- /* GP_REGS */ {~0, 0}, \
+- /* ALL_REGS */ {~0,~0} \
++ /* NO_REGS */ { 0, 0}, \
++ /* SIB_REGS */ { 0xfe0c, 0}, \
++ /* IJMP_REGS */ { 0x7fffffff, 0}, \
++ /* GP_REGS */ {~0, 0}, \
++ /* ALL_REGS */ {~0,~0} \
+ }
+
+
+diff --git a/gcc/config/nios2/nios2.md b/gcc/config/nios2/nios2.md
+index 7b35d269..36ef101 100644
+--- a/gcc/config/nios2/nios2.md
++++ b/gcc/config/nios2/nios2.md
+@@ -697,7 +697,7 @@
+ ; check or adjust for overflow.
+
+ (define_insn "indirect_jump"
+- [(set (pc) (match_operand:SI 0 "register_operand" "r"))]
++ [(set (pc) (match_operand:SI 0 "register_operand" "c"))]
+ ""
+ "jmp\\t%0"
+ [(set_attr "type" "control")])
+@@ -811,7 +811,7 @@
+
+ (define_insn "*tablejump"
+ [(set (pc)
+- (match_operand:SI 0 "register_operand" "r"))
++ (match_operand:SI 0 "register_operand" "c"))
+ (use (label_ref (match_operand 1 "" "")))]
+ ""
+ "jmp\\t%0"
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch
new file mode 100644
index 000000000..c18f40e74
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0053-expr.c-PR-target-65358-Avoid-clobbering-partial-argu.patch
@@ -0,0 +1,307 @@
+From 536b8318974495cde2b42c3c2742748e2b271be0 Mon Sep 17 00:00:00 2001
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 27 May 2015 13:25:01 +0000
+Subject: [PATCH] PR target/65358 Avoid clobbering partial argument during
+ sibcall
+
+ PR target/65358
+ * expr.c (memory_load_overlap): New function.
+ (emit_push_insn): When pushing partial args to the stack would
+ clobber the register part load the overlapping part into a pseudo
+ and put it into the hard reg after pushing. Change return type
+ to bool. Add bool argument.
+ * expr.h (emit_push_insn): Change return type to bool.
+ Add bool argument.
+ * calls.c (expand_call): Cancel sibcall optimization when encountering
+ partial argument on targets with ARGS_GROW_DOWNWARD and
+ !STACK_GROWS_DOWNWARD.
+ (emit_library_call_value_1): Update callsite of emit_push_insn.
+ (store_one_arg): Likewise.
+
+ PR target/65358
+ * gcc.dg/pr65358.c: New test.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223753 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport from 6.0
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ gcc/calls.c | 17 ++++++--
+ gcc/expr.c | 90 +++++++++++++++++++++++++++++++++++++-----
+ gcc/expr.h | 4 +-
+ gcc/testsuite/gcc.dg/pr65358.c | 33 ++++++++++++++++
+ 4 files changed, 129 insertions(+), 15 deletions(-)
+ create mode 100644 gcc/testsuite/gcc.dg/pr65358.c
+
+diff --git a/gcc/calls.c b/gcc/calls.c
+index ee8ea5f..2334381 100644
+--- a/gcc/calls.c
++++ b/gcc/calls.c
+@@ -3236,6 +3236,14 @@ expand_call (tree exp, rtx target, int ignore)
+ {
+ rtx_insn *before_arg = get_last_insn ();
+
++ /* On targets with weird calling conventions (e.g. PA) it's
++ hard to ensure that all cases of argument overlap between
++ stack and registers work. Play it safe and bail out. */
++#if defined(ARGS_GROW_DOWNWARD) && !defined(STACK_GROWS_DOWNWARD)
++ sibcall_failure = 1;
++ break;
++#endif
++
+ if (store_one_arg (&args[i], argblock, flags,
+ adjusted_args_size.var != 0,
+ reg_parm_stack_space)
+@@ -4279,7 +4287,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
+ partial, reg, 0, argblock,
+ GEN_INT (argvec[argnum].locate.offset.constant),
+ reg_parm_stack_space,
+- ARGS_SIZE_RTX (argvec[argnum].locate.alignment_pad));
++ ARGS_SIZE_RTX (argvec[argnum].locate.alignment_pad), false);
+
+ /* Now mark the segment we just used. */
+ if (ACCUMULATE_OUTGOING_ARGS)
+@@ -4886,10 +4894,11 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags,
+
+ /* This isn't already where we want it on the stack, so put it there.
+ This can either be done with push or copy insns. */
+- emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), NULL_RTX,
++ if (!emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), NULL_RTX,
+ parm_align, partial, reg, used - size, argblock,
+ ARGS_SIZE_RTX (arg->locate.offset), reg_parm_stack_space,
+- ARGS_SIZE_RTX (arg->locate.alignment_pad));
++ ARGS_SIZE_RTX (arg->locate.alignment_pad), true))
++ sibcall_failure = 1;
+
+ /* Unless this is a partially-in-register argument, the argument is now
+ in the stack. */
+@@ -5001,7 +5010,7 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags,
+ emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx,
+ parm_align, partial, reg, excess, argblock,
+ ARGS_SIZE_RTX (arg->locate.offset), reg_parm_stack_space,
+- ARGS_SIZE_RTX (arg->locate.alignment_pad));
++ ARGS_SIZE_RTX (arg->locate.alignment_pad), false);
+
+ /* Unless this is a partially-in-register argument, the argument is now
+ in the stack.
+diff --git a/gcc/expr.c b/gcc/expr.c
+index 5c09550..24a6293 100644
+--- a/gcc/expr.c
++++ b/gcc/expr.c
+@@ -4121,12 +4121,35 @@ emit_single_push_insn (machine_mode mode, rtx x, tree type)
+ }
+ #endif
+
++/* If reading SIZE bytes from X will end up reading from
++ Y return the number of bytes that overlap. Return -1
++ if there is no overlap or -2 if we can't determine
++ (for example when X and Y have different base registers). */
++
++static int
++memory_load_overlap (rtx x, rtx y, HOST_WIDE_INT size)
++{
++ rtx tmp = plus_constant (Pmode, x, size);
++ rtx sub = simplify_gen_binary (MINUS, Pmode, tmp, y);
++
++ if (!CONST_INT_P (sub))
++ return -2;
++
++ HOST_WIDE_INT val = INTVAL (sub);
++
++ return IN_RANGE (val, 1, size) ? val : -1;
++}
++
+ /* Generate code to push X onto the stack, assuming it has mode MODE and
+ type TYPE.
+ MODE is redundant except when X is a CONST_INT (since they don't
+ carry mode info).
+ SIZE is an rtx for the size of data to be copied (in bytes),
+ needed only if X is BLKmode.
++ Return true if successful. May return false if asked to push a
++ partial argument during a sibcall optimization (as specified by
++ SIBCALL_P) and the incoming and outgoing pointers cannot be shown
++ to not overlap.
+
+ ALIGN (in bits) is maximum alignment we can assume.
+
+@@ -4152,11 +4175,11 @@ emit_single_push_insn (machine_mode mode, rtx x, tree type)
+ for arguments passed in registers. If nonzero, it will be the number
+ of bytes required. */
+
+-void
++bool
+ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+ unsigned int align, int partial, rtx reg, int extra,
+ rtx args_addr, rtx args_so_far, int reg_parm_stack_space,
+- rtx alignment_pad)
++ rtx alignment_pad, bool sibcall_p)
+ {
+ rtx xinner;
+ enum direction stack_direction
+@@ -4179,6 +4202,10 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+
+ xinner = x;
+
++ int nregs = partial / UNITS_PER_WORD;
++ rtx *tmp_regs = NULL;
++ int overlapping = 0;
++
+ if (mode == BLKmode
+ || (STRICT_ALIGNMENT && align < GET_MODE_ALIGNMENT (mode)))
+ {
+@@ -4309,6 +4336,43 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+ PARM_BOUNDARY. Assume the caller isn't lying. */
+ set_mem_align (target, align);
+
++ /* If part should go in registers and pushing to that part would
++ overwrite some of the values that need to go into regs, load the
++ overlapping values into temporary pseudos to be moved into the hard
++ regs at the end after the stack pushing has completed.
++ We cannot load them directly into the hard regs here because
++ they can be clobbered by the block move expansions.
++ See PR 65358. */
++
++ if (partial > 0 && reg != 0 && mode == BLKmode
++ && GET_CODE (reg) != PARALLEL)
++ {
++ overlapping = memory_load_overlap (XEXP (x, 0), temp, partial);
++ if (overlapping > 0)
++ {
++ gcc_assert (overlapping % UNITS_PER_WORD == 0);
++ overlapping /= UNITS_PER_WORD;
++
++ tmp_regs = XALLOCAVEC (rtx, overlapping);
++
++ for (int i = 0; i < overlapping; i++)
++ tmp_regs[i] = gen_reg_rtx (word_mode);
++
++ for (int i = 0; i < overlapping; i++)
++ emit_move_insn (tmp_regs[i],
++ operand_subword_force (target, i, mode));
++ }
++ else if (overlapping == -1)
++ overlapping = 0;
++ /* Could not determine whether there is overlap.
++ Fail the sibcall. */
++ else
++ {
++ overlapping = 0;
++ if (sibcall_p)
++ return false;
++ }
++ }
+ emit_block_move (target, xinner, size, BLOCK_OP_CALL_PARM);
+ }
+ }
+@@ -4363,12 +4427,13 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+ has a size a multiple of a word. */
+ for (i = size - 1; i >= not_stack; i--)
+ if (i >= not_stack + offset)
+- emit_push_insn (operand_subword_force (x, i, mode),
++ if (!emit_push_insn (operand_subword_force (x, i, mode),
+ word_mode, NULL_TREE, NULL_RTX, align, 0, NULL_RTX,
+ 0, args_addr,
+ GEN_INT (args_offset + ((i - not_stack + skip)
+ * UNITS_PER_WORD)),
+- reg_parm_stack_space, alignment_pad);
++ reg_parm_stack_space, alignment_pad, sibcall_p))
++ return false;
+ }
+ else
+ {
+@@ -4411,9 +4476,8 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+ }
+ }
+
+- /* If part should go in registers, copy that part
+- into the appropriate registers. Do this now, at the end,
+- since mem-to-mem copies above may do function calls. */
++ /* Move the partial arguments into the registers and any overlapping
++ values that we moved into the pseudos in tmp_regs. */
+ if (partial > 0 && reg != 0)
+ {
+ /* Handle calls that pass values in multiple non-contiguous locations.
+@@ -4421,9 +4485,15 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+ if (GET_CODE (reg) == PARALLEL)
+ emit_group_load (reg, x, type, -1);
+ else
+- {
++ {
+ gcc_assert (partial % UNITS_PER_WORD == 0);
+- move_block_to_reg (REGNO (reg), x, partial / UNITS_PER_WORD, mode);
++ move_block_to_reg (REGNO (reg), x, nregs - overlapping, mode);
++
++ for (int i = 0; i < overlapping; i++)
++ emit_move_insn (gen_rtx_REG (word_mode, REGNO (reg)
++ + nregs - overlapping + i),
++ tmp_regs[i]);
++
+ }
+ }
+
+@@ -4432,6 +4502,8 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
+
+ if (alignment_pad && args_addr == 0)
+ anti_adjust_stack (alignment_pad);
++
++ return true;
+ }
+
+ /* Return X if X can be used as a subtarget in a sequence of arithmetic
+diff --git a/gcc/expr.h b/gcc/expr.h
+index 867852e..5fcc13f 100644
+--- a/gcc/expr.h
++++ b/gcc/expr.h
+@@ -218,8 +218,8 @@ extern rtx emit_move_resolve_push (machine_mode, rtx);
+ extern rtx push_block (rtx, int, int);
+
+ /* Generate code to push something onto the stack, given its mode and type. */
+-extern void emit_push_insn (rtx, machine_mode, tree, rtx, unsigned int,
+- int, rtx, int, rtx, rtx, int, rtx);
++extern bool emit_push_insn (rtx, machine_mode, tree, rtx, unsigned int,
++ int, rtx, int, rtx, rtx, int, rtx, bool);
+
+ /* Expand an assignment that stores the value of FROM into TO. */
+ extern void expand_assignment (tree, tree, bool);
+diff --git a/gcc/testsuite/gcc.dg/pr65358.c b/gcc/testsuite/gcc.dg/pr65358.c
+new file mode 100644
+index 0000000..ba89fd4
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/pr65358.c
+@@ -0,0 +1,33 @@
++/* { dg-do run } */
++/* { dg-options "-O2" } */
++
++struct pack
++{
++ int fine;
++ int victim;
++ int killer;
++};
++
++int __attribute__ ((__noinline__, __noclone__))
++bar (int a, int b, struct pack p)
++{
++ if (a != 20 || b != 30)
++ __builtin_abort ();
++ if (p.fine != 40 || p.victim != 50 || p.killer != 60)
++ __builtin_abort ();
++ return 0;
++}
++
++int __attribute__ ((__noinline__, __noclone__))
++foo (int arg1, int arg2, int arg3, struct pack p)
++{
++ return bar (arg2, arg3, p);
++}
++
++int main (void)
++{
++ struct pack p = { 40, 50, 60 };
++
++ (void) foo (10, 20, 30, p);
++ return 0;
++}
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch
new file mode 100644
index 000000000..da1687913
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0054-support-ffile-prefix-map.patch
@@ -0,0 +1,284 @@
+From ef7c2bda6b4c88f8007ed663b1108cd4651598c8 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 16 Mar 2016 02:27:43 -0400
+Subject: [PATCH] gcc/libcpp: support -ffile-prefix-map=<old>=<new>
+
+Similar -fdebug-prefix-map, add option -ffile-prefix-map to map one
+directory name (old) to another (new) in __FILE__, __BASE_FILE__ and
+__builtin_FILE ().
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
+
+Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/c-family/c-opts.c | 6 ++++
+ gcc/c-family/c.opt | 4 +++
+ gcc/dwarf2out.c | 1 +
+ gcc/gimplify.c | 2 ++
+ libcpp/Makefile.in | 10 +++---
+ libcpp/file-map.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++
+ libcpp/include/file-map.h | 30 ++++++++++++++++
+ libcpp/macro.c | 2 ++
+ 8 files changed, 142 insertions(+), 5 deletions(-)
+ create mode 100644 libcpp/file-map.c
+ create mode 100644 libcpp/include/file-map.h
+
+diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
+index 718a052..3f93c56 100644
+--- a/gcc/c-family/c-opts.c
++++ b/gcc/c-family/c-opts.c
+@@ -46,6 +46,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "opts.h"
+ #include "plugin.h" /* For PLUGIN_INCLUDE_FILE event. */
+ #include "mkdeps.h"
++#include "file-map.h"
+ #include "c-target.h"
+ #include "tm.h" /* For BYTES_BIG_ENDIAN,
+ DOLLARS_IN_IDENTIFIERS,
+@@ -510,6 +511,11 @@ c_common_handle_option (size_t scode, const char *arg, int value,
+ cpp_opts->narrow_charset = arg;
+ break;
+
++ case OPT_ffile_prefix_map_:
++ if (add_file_prefix_map (arg) < 0)
++ error ("invalid argument %qs to -ffile-prefix-map", arg);
++ break;
++
+ case OPT_fwide_exec_charset_:
+ cpp_opts->wide_charset = arg;
+ break;
+diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
+index 453ec8e..30ad053 100644
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -1117,6 +1117,10 @@ fexec-charset=
+ C ObjC C++ ObjC++ Joined RejectNegative
+ -fexec-charset=<cset> Convert all strings and character constants to character set <cset>
+
++ffile-prefix-map=
++C ObjC C++ ObjC++ Joined RejectNegative
++-ffile-prefix-map=<old=new> Map one directory name to another in __FILE__, __BASE_FILE__ and __builtin_FILE ()
++
+ fextended-identifiers
+ C ObjC C++ ObjC++
+ Permit universal character names (\\u and \\U) in identifiers
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index 526f114..438a475 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -19671,6 +19671,7 @@ gen_producer_string (void)
+ case OPT_fltrans_output_list_:
+ case OPT_fresolution_:
+ case OPT_fdebug_prefix_map_:
++ case OPT_ffile_prefix_map_:
+ /* Ignore these. */
+ continue;
+ default:
+diff --git a/gcc/gimplify.c b/gcc/gimplify.c
+index c85f83a..1ffe1e1 100644
+--- a/gcc/gimplify.c
++++ b/gcc/gimplify.c
+@@ -87,6 +87,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "gimple-low.h"
+ #include "cilk.h"
+ #include "gomp-constants.h"
++#include "file-map.h"
+
+ #include "langhooks-def.h" /* FIXME: for lhd_set_decl_assembler_name */
+ #include "tree-pass.h" /* FIXME: only for PROP_gimple_any */
+@@ -2370,6 +2371,7 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
+ case BUILT_IN_FILE:
+ {
+ const char *locfile = LOCATION_FILE (EXPR_LOCATION (*expr_p));
++ locfile = remap_file_filename (locfile);
+ *expr_p = build_string_literal (strlen (locfile) + 1, locfile);
+ return GS_OK;
+ }
+diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in
+index ad35563..c210ff9 100644
+--- a/libcpp/Makefile.in
++++ b/libcpp/Makefile.in
+@@ -84,12 +84,12 @@ DEPMODE = $(CXXDEPMODE)
+
+
+ libcpp_a_OBJS = charset.o directives.o directives-only.o errors.o \
+- expr.o files.o identifiers.o init.o lex.o line-map.o macro.o \
+- mkdeps.o pch.o symtab.o traditional.o
++ expr.o file-map.o files.o identifiers.o init.o lex.o line-map.o \
++ macro.o mkdeps.o pch.o symtab.o traditional.o
+
+ libcpp_a_SOURCES = charset.c directives.c directives-only.c errors.c \
+- expr.c files.c identifiers.c init.c lex.c line-map.c macro.c \
+- mkdeps.c pch.c symtab.c traditional.c
++ expr.c file-map.c files.c identifiers.c init.c lex.c line-map.c \
++ macro.c mkdeps.c pch.c symtab.c traditional.c
+
+ all: libcpp.a $(USED_CATALOGS)
+
+@@ -263,7 +263,7 @@ po/$(PACKAGE).pot: $(libcpp_a_SOURCES)
+
+ TAGS_SOURCES = $(libcpp_a_SOURCES) internal.h ucnid.h \
+ include/line-map.h include/symtab.h include/cpp-id-data.h \
+- include/cpplib.h include/mkdeps.h system.h
++ include/cpplib.h include/mkdeps.h system.h include/file-map.h
+
+ TAGS: $(TAGS_SOURCES)
+ cd $(srcdir) && etags $(TAGS_SOURCES)
+diff --git a/libcpp/file-map.c b/libcpp/file-map.c
+new file mode 100644
+index 0000000..04e851b
+--- /dev/null
++++ b/libcpp/file-map.c
+@@ -0,0 +1,92 @@
++/* Map one directory name to another in __FILE__, __BASE_FILE__
++ and __builtin_FILE ().
++ Copyright (C) 2001-2016 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; see the file COPYING3. If not see
++<http://www.gnu.org/licenses/>.
++
++ In other words, you are welcome to use, share and improve this program.
++ You are forbidden to forbid anyone else to use, share and improve
++ what you give them. Help stamp out software-hoarding! */
++
++#include "config.h"
++#include "system.h"
++#include "file-map.h"
++
++/* Structure recording the mapping from source file and directory
++ names at compile time to __FILE__ */
++typedef struct file_prefix_map
++{
++ const char *old_prefix;
++ const char *new_prefix;
++ size_t old_len;
++ size_t new_len;
++ struct file_prefix_map *next;
++} file_prefix_map;
++
++/* Linked list of such structures. */
++static file_prefix_map *file_prefix_maps;
++
++/* Record prefix mapping of __FILE__. ARG is the argument to
++ -ffile-prefix-map and must be of the form OLD=NEW. */
++int
++add_file_prefix_map (const char *arg)
++{
++ file_prefix_map *map;
++ const char *p;
++
++ p = strchr (arg, '=');
++ if (!p)
++ {
++ fprintf(stderr, "invalid argument %qs to -ffile-prefix-map", arg);
++ return -1;
++ }
++ map = XNEW (file_prefix_map);
++ map->old_prefix = xstrndup (arg, p - arg);
++ map->old_len = p - arg;
++ p++;
++ map->new_prefix = xstrdup (p);
++ map->new_len = strlen (p);
++ map->next = file_prefix_maps;
++ file_prefix_maps = map;
++
++ return 0;
++}
++
++/* Perform user-specified mapping of __FILE__ prefixes. Return
++ the new name corresponding to filename. */
++
++const char *
++remap_file_filename (const char *filename)
++{
++ file_prefix_map *map;
++ char *s;
++ const char *name;
++ size_t name_len;
++
++ for (map = file_prefix_maps; map; map = map->next)
++ if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
++ break;
++ if (!map)
++ return filename;
++ name = filename + map->old_len;
++ name_len = strlen (name) + 1;
++ s = (char *) alloca (name_len + map->new_len);
++ memcpy (s, map->new_prefix, map->new_len);
++ memcpy (s + map->new_len, name, name_len);
++
++ return xstrdup (s);
++}
++
++
+diff --git a/libcpp/include/file-map.h b/libcpp/include/file-map.h
+new file mode 100644
+index 0000000..e6f8cbf
+--- /dev/null
++++ b/libcpp/include/file-map.h
+@@ -0,0 +1,30 @@
++/* Map one directory name to another in __FILE__, __BASE_FILE__
++ and __builtin_FILE ().
++ Copyright (C) 2001-2016 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; see the file COPYING3. If not see
++<http://www.gnu.org/licenses/>.
++
++ In other words, you are welcome to use, share and improve this program.
++ You are forbidden to forbid anyone else to use, share and improve
++ what you give them. Help stamp out software-hoarding! */
++
++#ifndef LIBCPP_FILE_MAP_H
++#define LIBCPP_FILE_MAP_H
++
++const char * remap_file_filename (const char *filename);
++
++int add_file_prefix_map (const char *arg);
++
++#endif /* !LIBCPP_FILE_MAP_H */
+diff --git a/libcpp/macro.c b/libcpp/macro.c
+index 1e0a0b5..c3d330c 100644
+--- a/libcpp/macro.c
++++ b/libcpp/macro.c
+@@ -26,6 +26,7 @@ along with this program; see the file COPYING3. If not see
+ #include "system.h"
+ #include "cpplib.h"
+ #include "internal.h"
++#include "file-map.h"
+
+ typedef struct macro_arg macro_arg;
+ /* This structure represents the tokens of a macro argument. These
+@@ -297,6 +298,7 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node)
+ if (!name)
+ abort ();
+ }
++ name = remap_file_filename (name);
+ len = strlen (name);
+ buf = _cpp_unaligned_alloc (pfile, len * 2 + 3);
+ result = buf;
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
new file mode 100644
index 000000000..c7caed8c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0055-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
@@ -0,0 +1,43 @@
+From 14b79641ff6b0008aef7fbf7aa300daec11d1e78 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 16 Mar 2016 05:39:59 -0400
+Subject: [PATCH] Reuse -fdebug-prefix-map to replace -ffile-prefix-map
+
+The oe-core may use external toolchain to compile,
+which may not support -ffile-prefix-map.
+
+Since we use -fdebug-prefix-map to do the same thing,
+so we could reuse it to replace -ffile-prefix-map.
+
+Upstream-Status: Inappropriate[oe-core specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/opts-global.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/gcc/opts-global.c b/gcc/opts-global.c
+index b61bdcf..51bb177 100644
+--- a/gcc/opts-global.c
++++ b/gcc/opts-global.c
+@@ -50,6 +50,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "rtl.h"
+ #include "dbgcnt.h"
+ #include "debug.h"
++#include "file-map.h"
+ #include "hash-map.h"
+ #include "plugin-api.h"
+ #include "ipa-ref.h"
+@@ -378,6 +379,9 @@ handle_common_deferred_options (void)
+
+ case OPT_fdebug_prefix_map_:
+ add_debug_prefix_map (opt->arg);
++
++ /* Reuse -fdebug-prefix-map to replace -ffile-prefix-map */
++ add_file_prefix_map (opt->arg);
+ break;
+
+ case OPT_fdump_:
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch
new file mode 100644
index 000000000..97913420e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0056-Enable-libc-provide-ssp-and-gcc_cv_target_dl_iterate.patch
@@ -0,0 +1,85 @@
+From 5c7bd853c8703f65904083778712ef625c3f3814 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 27 Mar 2016 20:31:50 -0700
+Subject: [PATCH 56/57] Enable libc provide ssp and
+ gcc_cv_target_dl_iterate_phdr for musl
+
+ * configure.ac (gcc_cv_libc_provides_ssp): Add *-*-musl*.
+ (gcc_cv_target_dl_iterate_phdr): Add *-linux-musl*.
+ * configure: Regenerate.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Backport
+
+ gcc/configure | 7 +++++++
+ gcc/configure.ac | 7 +++++++
+ 2 files changed, 14 insertions(+)
+
+diff --git a/gcc/configure b/gcc/configure
+index fcb05e7..81a449c 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -27814,6 +27814,9 @@ if test "${gcc_cv_libc_provides_ssp+set}" = set; then :
+ else
+ gcc_cv_libc_provides_ssp=no
+ case "$target" in
++ *-*-musl*)
++ # All versions of musl provide stack protector
++ gcc_cv_libc_provides_ssp=yes;;
+ *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
+ # glibc 2.4 and later provides __stack_chk_fail and
+ # either __stack_chk_guard, or TLS access to stack guard canary.
+@@ -27846,6 +27849,7 @@ fi
+ # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
+ # simply assert that glibc does provide this, which is true for all
+ # realistically usable GNU/Hurd configurations.
++ # All supported versions of musl provide it as well
+ gcc_cv_libc_provides_ssp=yes;;
+ *-*-darwin* | *-*-freebsd*)
+ ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
+@@ -27942,6 +27946,9 @@ case "$target" in
+ gcc_cv_target_dl_iterate_phdr=no
+ fi
+ ;;
++ *-linux-musl*)
++ gcc_cv_target_dl_iterate_phdr=yes
++ ;;
+ esac
+
+ if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 923bc9a..b08e3dc 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5291,6 +5291,9 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library,
+ gcc_cv_libc_provides_ssp,
+ [gcc_cv_libc_provides_ssp=no
+ case "$target" in
++ *-*-musl*)
++ # All versions of musl provide stack protector
++ gcc_cv_libc_provides_ssp=yes;;
+ *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
+ # glibc 2.4 and later provides __stack_chk_fail and
+ # either __stack_chk_guard, or TLS access to stack guard canary.
+@@ -5317,6 +5320,7 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library,
+ # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
+ # simply assert that glibc does provide this, which is true for all
+ # realistically usable GNU/Hurd configurations.
++ # All supported versions of musl provide it as well
+ gcc_cv_libc_provides_ssp=yes;;
+ *-*-darwin* | *-*-freebsd*)
+ AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
+@@ -5390,6 +5394,9 @@ case "$target" in
+ gcc_cv_target_dl_iterate_phdr=no
+ fi
+ ;;
++ *-linux-musl*)
++ gcc_cv_target_dl_iterate_phdr=yes
++ ;;
+ esac
+ GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
+ if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
+--
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0057-unwind-fix-for-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0057-unwind-fix-for-musl.patch
new file mode 100644
index 000000000..c193587bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0057-unwind-fix-for-musl.patch
@@ -0,0 +1,42 @@
+From c5c33bf881a2aea355310dd90873ed39bc272b3c Mon Sep 17 00:00:00 2001
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 22 Apr 2015 14:20:01 +0000
+Subject: [PATCH 57/57] unwind fix for musl
+
+On behalf of szabolcs.nagy@arm.com
+
+2015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca>
+ Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * unwind-dw2-fde-dip.c (USE_PT_GNU_EH_FRAME): Define it on
+ Linux if target provides dl_iterate_phdr.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222328 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Backport
+
+ libgcc/unwind-dw2-fde-dip.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
+index e1e566b..137dced 100644
+--- a/libgcc/unwind-dw2-fde-dip.c
++++ b/libgcc/unwind-dw2-fde-dip.c
+@@ -59,6 +59,12 @@
+
+ #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+ && defined(TARGET_DL_ITERATE_PHDR) \
++ && defined(__linux__)
++# define USE_PT_GNU_EH_FRAME
++#endif
++
++#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
++ && defined(TARGET_DL_ITERATE_PHDR) \
+ && (defined(__DragonFly__) || defined(__FreeBSD__))
+ # define ElfW __ElfN
+ # define USE_PT_GNU_EH_FRAME
+--
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0058-fdebug-prefix-map-support-to-remap-relative-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0058-fdebug-prefix-map-support-to-remap-relative-path.patch
new file mode 100644
index 000000000..0b91fdbbc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-5.3/0058-fdebug-prefix-map-support-to-remap-relative-path.patch
@@ -0,0 +1,51 @@
+From 289ad2969a5966c603bf6928ce442db74c4cbb25 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 24 Mar 2016 11:23:14 -0400
+Subject: [PATCH] gcc/final.c: -fdebug-prefix-map support to remap sources with
+ relative path
+
+PR other/70428
+* final.c (remap_debug_filename): Use lrealpath to translate
+relative path before remapping
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70428
+Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+diff --git a/gcc/final.c b/gcc/final.c
+index 55cf509..c3594c2 100644
+--- a/gcc/final.c
++++ b/gcc/final.c
+@@ -1554,16 +1554,25 @@ remap_debug_filename (const char *filename)
+ const char *name;
+ size_t name_len;
+
++ /* Support to remap filename with relative path */
++ char *realpath = lrealpath (filename);
++ if (realpath == NULL)
++ return filename;
++
+ for (map = debug_prefix_maps; map; map = map->next)
+- if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
++ if (filename_ncmp (realpath, map->old_prefix, map->old_len) == 0)
+ break;
+ if (!map)
+- return filename;
+- name = filename + map->old_len;
++ {
++ free (realpath);
++ return filename;
++ }
++ name = realpath + map->old_len;
+ name_len = strlen (name) + 1;
+ s = (char *) alloca (name_len + map->new_len);
+ memcpy (s, map->new_prefix, map->new_len);
+ memcpy (s + map->new_len, name, name_len);
++ free (realpath);
+ return ggc_strdup (s);
+ }
+
+--
+2.7.4
+
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
new file mode 100644
index 000000000..e4fd4d6f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-common.inc
@@ -0,0 +1,105 @@
+SUMMARY = "GNU cc and gcc C compilers"
+HOMEPAGE = "http://www.gnu.org/software/gcc/"
+SECTION = "devel"
+LICENSE = "GPL"
+
+NATIVEDEPS = ""
+
+inherit autotools gettext texinfo
+
+BPN = "gcc"
+
+def get_gcc_float_setting(bb, d):
+ if d.getVar('ARMPKGSFX_EABI', True) == "hf" and d.getVar('TRANSLATED_TARGET_ARCH', True) == "arm":
+ return "--with-float=hard"
+ if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
+ return "--with-float=soft"
+ if d.getVar('TARGET_FPU', True) 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):
+ 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):
+ 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' ]:
+ return "--with-long-double-128"
+ return ""
+
+def get_gcc_multiarch_setting(bb, d):
+ target_arch = d.getVar('TRANSLATED_TARGET_ARCH', True)
+ multiarch_options = {
+ "i586": "--enable-targets=all",
+ "i686": "--enable-targets=all",
+ "powerpc": "--enable-targets=powerpc64",
+ "mips": "--enable-targets=all",
+ "sparc": "--enable-targets=all",
+ }
+
+ if bb.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d):
+ if target_arch in multiarch_options :
+ return multiarch_options[target_arch]
+ return ""
+
+# this is used by the multilib setup of gcc
+def get_tune_parameters(tune, d):
+ availtunes = d.getVar('AVAILTUNES', True)
+ 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)
+ # 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)
+ 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"
+
+DEBIANNAME_${MLPREFIX}libgcc = "libgcc1"
+
+MIRRORS =+ "\
+${GNU_MIRROR}/gcc ftp://gcc.gnu.org/pub/gcc/releases/ \n \
+${GNU_MIRROR}/gcc ftp://gd.tuwien.ac.at/gnu/gcc/ \n \
+${GNU_MIRROR}/gcc http://mirrors.rcn.net/pub/sourceware/gcc/releases/ \n \
+${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \
+${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \
+"
+#
+# Set some default values
+#
+gcclibdir = "${libdir}/gcc"
+BINV = "${PV}"
+#S = "${WORKDIR}/gcc-${PV}"
+S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
+
+target_includedir ?= "${includedir}"
+target_libdir ?= "${libdir}"
+target_base_libdir ?= "${base_libdir}"
+target_prefix ?= "${prefix}"
+
+# We need to ensure that for the shared work directory, the do_patch signatures match
+# The real WORKDIR location isn't a dependency for the shared workdir.
+src_patches[vardepsexclude] = "WORKDIR"
+should_apply[vardepsexclude] += "PN"
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
new file mode 100644
index 000000000..f4f76bda5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -0,0 +1,122 @@
+require gcc-multilib-config.inc
+require gcc-shared-source.inc
+#
+# Build the list of lanaguages to build.
+#
+# These can be overridden by the version specific .inc file.
+
+# Java (gcj doesn't work on all architectures)
+JAVA ?= ",java"
+JAVA_arm ?= ""
+JAVA_armeb ?= ""
+JAVA_mipsel ?= ""
+JAVA_sh3 ?= ""
+# gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'
+FORTRAN ?= ",f77"
+LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
+
+EXTRA_OECONF_BASE ?= ""
+EXTRA_OECONF_PATHS ?= ""
+EXTRA_OECONF_INITIAL ?= ""
+
+GCCMULTILIB ?= "--disable-multilib"
+GCCTHREADS ?= "posix"
+
+EXTRA_OECONF = "\
+ ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS', True) != 'no']} \
+ --with-gnu-ld \
+ --enable-shared \
+ --enable-languages=${LANGUAGES} \
+ --enable-threads=${GCCTHREADS} \
+ ${GCCMULTILIB} \
+ --enable-c99 \
+ --enable-long-long \
+ --enable-symvers=gnu \
+ --enable-libstdcxx-pch \
+ --program-prefix=${TARGET_PREFIX} \
+ --without-local-prefix \
+ ${EXTRA_OECONF_BASE} \
+ ${EXTRA_OECONF_GCC_FLOAT} \
+ ${EXTRA_OECONF_PATHS} \
+ ${@get_gcc_mips_plt_setting(bb, d)} \
+ ${@get_gcc_ppc_plt_settings(bb, d)} \
+ ${@get_long_double_setting(bb, d)} \
+ ${@get_gcc_multiarch_setting(bb, d)} \
+"
+
+export gcc_cv_collect2_libs = 'none required'
+# We need to set gcc_cv_collect2_libs else there is cross-compilation badness
+# in the config.log files (which might not get generated until do_compile
+# hence being missed by the insane do_configure check).
+
+# Build uclibc compilers without cxa_atexit support
+EXTRA_OECONF_append_linux = " --enable-__cxa_atexit"
+EXTRA_OECONF_append_libc-uclibc = " --enable-__cxa_atexit"
+
+EXTRA_OECONF_append_mips64 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64el = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64n32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64eln32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+
+# ARMv6+ adds atomic instructions that affect the ABI in libraries built
+# with TUNE_CCARGS in gcc-runtime. Make the compiler default to a
+# compatible architecture. armv6 and armv7a cover the minimum tune
+# features used in OE.
+EXTRA_OECONF_append_armv6 = " --with-arch=armv6"
+EXTRA_OECONF_append_armv7a = " --with-arch=armv7-a"
+EXTRA_OECONF_append_armv7ve = " --with-arch=armv7-a"
+
+EXTRA_OECONF_GCC_FLOAT ??= ""
+CPPFLAGS = ""
+
+SYSTEMHEADERS = "${target_includedir}"
+SYSTEMLIBS = "${target_base_libdir}/"
+SYSTEMLIBS1 = "${target_libdir}/"
+
+do_configure_prepend () {
+ # teach gcc to find correct target includedir when checking libc ssp support
+ mkdir -p ${B}/gcc
+ echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${B}/gcc/t-oe
+ cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${B}/gcc/defaults.h.new
+ cat >>${B}/gcc/defaults.h.new <<_EOF
+#define NATIVE_SYSTEM_HEADER_DIR "${SYSTEMHEADERS}"
+#define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}"
+#define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}"
+#define SYSTEMLIBS_DIR "${SYSTEMLIBS}"
+#endif /* ! GCC_DEFAULTS_H */
+_EOF
+ mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h
+}
+
+do_configure () {
+ # Setup these vars for cross building only
+ # ... because foo_FOR_TARGET apparently gets misinterpreted inside the
+ # gcc build stuff when the build is producing a cross compiler - i.e.
+ # when the 'current' target is the 'host' system, and the host is not
+ # the target (because the build is actually making a cross compiler!)
+ if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
+ export CC_FOR_TARGET="${CC}"
+ export GCC_FOR_TARGET="${CC}"
+ export CXX_FOR_TARGET="${CXX}"
+ export AS_FOR_TARGET="${HOST_PREFIX}as"
+ export LD_FOR_TARGET="${HOST_PREFIX}ld"
+ export NM_FOR_TARGET="${HOST_PREFIX}nm"
+ export AR_FOR_TARGET="${HOST_PREFIX}ar"
+ export GFORTRAN_FOR_TARGET="gfortran"
+ export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib"
+ fi
+ export CC_FOR_BUILD="${BUILD_CC}"
+ export CXX_FOR_BUILD="${BUILD_CXX}"
+ export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
+ export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}"
+ export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
+ export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}"
+ export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
+ export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
+ export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
+ export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
+
+
+ oe_runconf
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
new file mode 100644
index 000000000..ec1d28180
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -0,0 +1,172 @@
+inherit cross-canadian
+
+SUMMARY = "GNU cc and gcc C compilers (cross-canadian for ${TARGET_ARCH} target)"
+PN = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc nativesdk-gettext"
+
+GCCMULTILIB = "--enable-multilib"
+
+require gcc-configure-common.inc
+
+EXTRA_OECONF_PATHS = "\
+ --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \
+ --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+# We have to point gcc 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_PATHS[vardepsexclude] = "TUNE_PKGARCH"
+TARGET_ARCH[vardepsexclude] = "TUNE_ARCH"
+get_gcc_float_setting[vardepvalue] = ""
+
+#
+# gcc-cross looks and finds these in ${exec_prefix} but we're not so lucky
+# for the sdk. Hardcoding the paths ensures the build doesn't go canadian or worse.
+#
+export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
+export AS_FOR_TARGET = "${TARGET_PREFIX}as"
+export DLLTOOL_FOR_TARGET = "${TARGET_PREFIX}dlltool"
+export CC_FOR_TARGET = "${TARGET_PREFIX}gcc"
+export CXX_FOR_TARGET = "${TARGET_PREFIX}g++"
+export GCC_FOR_TARGET = "${TARGET_PREFIX}gcc"
+export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
+export LIPO_FOR_TARGET = "${TARGET_PREFIX}lipo"
+export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
+export OBJDUMP_FOR_TARGET = "${TARGET_PREFIX}objdump"
+export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
+export STRIP_FOR_TARGET = "${TARGET_PREFIX}strip"
+export WINDRES_FOR_TARGET = "${TARGET_PREFIX}windres"
+
+#
+# We need to override this and make sure the compiler can find staging
+#
+export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET}"
+
+do_configure () {
+ export CC_FOR_BUILD="${BUILD_CC}"
+ export CXX_FOR_BUILD="${BUILD_CXX}"
+ export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
+ export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}"
+ export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
+ export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}"
+ export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
+ export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
+ export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
+ export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
+ oe_runconf
+}
+
+do_compile () {
+ oe_runmake all-host configure-target-libgcc
+}
+
+# Having anything auto depending on gcc-cross-sdk is a really bad idea...
+EXCLUDE_FROM_SHLIBS = "1"
+
+PACKAGES = "${PN}-dbg ${PN} ${PN}-doc"
+
+FILES_${PN} = "\
+ ${exec_prefix}/bin/* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/* \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/lib* \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.* \
+ ${includedir}/c++/${BINV} \
+ ${prefix}/${TARGET_SYS}/bin/* \
+ ${prefix}/${TARGET_SYS}/lib/* \
+ ${prefix}/${TARGET_SYS}/usr/include/* \
+"
+INSANE_SKIP_${PN} += "dev-so"
+
+FILES_${PN}-doc = "\
+ ${infodir} \
+ ${mandir} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
+"
+
+EXEEXT = ""
+
+# Compute how to get from libexecdir to bindir in python (easier than shell)
+BINRELPATH = "${@os.path.relpath(d.expand("${bindir}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}"
+
+do_install () {
+ ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h )
+ oe_runmake 'DESTDIR=${D}' install-host
+
+ # Cleanup some of the ${libdir}{,exec}/gcc stuff ...
+ rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+ rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+ rm -rf ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
+
+ # We care about g++ not c++
+ rm -f ${D}${bindir}/*c++
+
+ # We don't care about the gcc-<version> copies
+ rm -f ${D}${bindir}/*gcc-?.?*
+
+ # We use libiberty from binutils
+ rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a
+ # Not sure where the strange paths come from
+ rm -f ${D}${libdir}/../lib/libiberty.a
+ rm -f ${D}${libdir}/libiberty.a
+
+ # Cleanup empty directories which are not shipped
+ # we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted
+ # ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686
+ local empty_dirs="${D}${libdir}/../lib ${D}${prefix}/${TARGET_SYS}/lib ${D}${prefix}/${TARGET_SYS} ${D}${includedir}"
+ for i in $empty_dirs; do
+ [ -d $i ] && rmdir --ignore-fail-on-non-empty $i
+ done
+
+ # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
+ # found.
+ dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
+ install -d $dest
+ suffix=${EXEEXT}
+ for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
+ if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then
+ continue
+ fi
+
+ ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t$suffix $dest$t$suffix
+ done
+ t=real-ld
+ ln -sf ${BINRELPATH}/${TARGET_PREFIX}ld$suffix $dest$t$suffix
+
+ # libquadmath headers need to be available in the gcc libexec dir
+ install -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+ cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+ cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+
+ chown -R root:root ${D}
+
+ cross_canadian_bindirlinks
+}
+
+ELFUTILS = "nativesdk-elfutils"
+DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib"
+RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}"
+
+SYSTEMHEADERS = "/usr/include"
+SYSTEMLIBS = "${target_base_libdir}/"
+SYSTEMLIBS1 = "${target_libdir}/"
+
+EXTRA_OECONF += "--enable-poison-system-directories"
+
+EXTRA_OECONF += "\
+ --with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \
+ --with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix} \
+"
+
+EXTRA_OECONF_append_libc-baremetal = " --without-headers"
+EXTRA_OECONF_remove_libc-baremetal = "--with-sysroot=/not/exist"
+EXTRA_OECONF_remove_libc-baremetal = "--with-build-sysroot=${STAGING_DIR_TARGET}"
+
+# gcc 4.7 needs -isystem
+export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_4.9.bb
new file mode 100644
index 000000000..bf53c5cd7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_4.9.bb
@@ -0,0 +1,5 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross-canadian.inc
+
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_5.3.bb
new file mode 100644
index 000000000..bf53c5cd7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-canadian_5.3.bb
@@ -0,0 +1,5 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross-canadian.inc
+
+
+
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
new file mode 100644
index 000000000..048b5302b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc
@@ -0,0 +1,100 @@
+DEPENDS = "virtual/${TARGET_PREFIX}binutils ${NATIVEDEPS}"
+PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial"
+PACKAGES = ""
+
+INHIBIT_AUTOTOOLS_DEPS = "1"
+INHIBIT_DEFAULT_DEPS = "1"
+
+# We still need gnu-config-native
+DEPENDS_prepend = "gnu-config-native autoconf-native "
+
+PN = "gcc-cross-initial-${TARGET_ARCH}"
+
+CROSS_TARGET_SYS_DIR_append = ".${PN}"
+
+# This is intended to be a -very- basic config
+# sysroot is needed in case we use libc-initial
+EXTRA_OECONF = "\
+ --with-newlib \
+ --without-headers \
+ --disable-shared \
+ --disable-threads \
+ --disable-multilib \
+ --disable-__cxa_atexit \
+ --enable-languages=c \
+ --program-prefix=${TARGET_PREFIX} \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${GCCCROSS_BUILDSYSROOT} \
+ ${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} \
+ ${@get_gcc_ppc_plt_settings(bb, d)} \
+"
+
+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
+
+ # We don't really need this (here shares/ contains man/, info/, locale/).
+ rm -rf ${D}${datadir}/
+
+ # 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
+
+ # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
+ # found. These need to be relative paths so they work in different locations.
+ dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
+ install -d $dest
+ useld=${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '.bfd', '', d)}
+ ln -sf ${BINRELPATH}/${TARGET_PREFIX}ld${useld} ${dest}ld
+ for t in ar as nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
+ ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
+ done
+ # fixed limits.h infact includes the so called real limits.h
+ # which should come from libc but when we build libc-initial
+ # then bunch of configure tests include fixed limits.h which in turn
+ # includes real limits.h but this real limits.h is not staged yet
+ # 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-${TARGET_ARCH})
+ 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
+#
+sysroot_stage_all() {
+ sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}
+ install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/
+ install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/
+ mv ${SYSROOT_DESTDIR}${target_base_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/ || true
+ 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}/"
+
+inherit nopackages
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_4.9.bb
new file mode 100644
index 000000000..4c73e5ce6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-cross-initial.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_5.3.bb
new file mode 100644
index 000000000..4c73e5ce6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross-initial_5.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-cross-initial.inc
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
new file mode 100644
index 000000000..f47936061
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -0,0 +1,197 @@
+inherit cross
+
+INHIBIT_DEFAULT_DEPS = "1"
+EXTRADEPENDS = ""
+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"):
+ d.setVar("EXTRADEPENDS", "linux-libc-headers")
+}
+
+PN = "gcc-cross-${TARGET_ARCH}"
+
+require gcc-configure-common.inc
+
+EXTRA_OECONF += "--enable-poison-system-directories"
+EXTRA_OECONF_append_sh4 = " \
+ --with-multilib-list= \
+ --enable-incomplete-targets \
+"
+
+EXTRA_OECONF += "\
+ --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
+ --with-system-zlib \
+"
+
+DEPENDS_remove_libc-baremetal := "virtual/${TARGET_PREFIX}libc-for-gcc"
+EXTRA_OECONF_append_libc-baremetal = " --without-headers"
+EXTRA_OECONF_remove_libc-baremetal = "--enable-threads=posix"
+
+EXTRA_OECONF_PATHS = "\
+ --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
+
+do_compile () {
+ export CC="${BUILD_CC}"
+ export AR_FOR_TARGET="${TARGET_SYS}-ar"
+ export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib"
+ export LD_FOR_TARGET="${TARGET_SYS}-ld"
+ export NM_FOR_TARGET="${TARGET_SYS}-nm"
+ export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc"
+ export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
+ export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
+ export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
+ export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
+
+ oe_runmake all-host configure-target-libgcc
+ # now generate script to drive testing
+ echo "#!/usr/bin/env sh" >${B}/${TARGET_PREFIX}testgcc
+ set >> ${B}/${TARGET_PREFIX}testgcc
+ # prune out the unneeded vars
+ sed -i -e "/^BASH/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^USER/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^OPT/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^DIRSTACK/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^EUID/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^FUNCNAME/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^GROUPS/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^HOST/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^HOME/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^IFS/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^LC_ALL/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^LOGNAME/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^MACHTYPE/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^OSTYPE/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^PIPE/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^SHELL/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^'/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^UID/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^TERM/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^PKG_/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^POSIXLY_/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^PPID/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^PS4/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^Q/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^SHLVL/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^STAGING/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^LD_LIBRARY_PATH/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^PSEUDO/d" ${B}/${TARGET_PREFIX}testgcc
+
+ # append execution part of the script
+cat >> ${B}/${TARGET_PREFIX}testgcc << STOP
+target="\$1"
+usage () {
+ echo "Usage:"
+ echo "\$0 user@target 'extra options to dejagnu'"
+ echo "\$0 target 'extra options to dejagnu'"
+ echo "\$0 target"
+ echo "e.g. \$0 192.168.7.2 ' dg.exp=visibility-d.c'"
+ echo "will only run visibility-d.c test case"
+ echo "e.g. \$0 192.168.7.2 '/-mthumb dg.exp=visibility-d.c'"
+ echo "will only run visibility-d.c test case in thumb mode"
+ echo "You need to have dejagnu autogen expect installed"
+ echo "on the build host"
+ }
+if [ "x\$target" = "x" ]
+then
+ echo "Please specify the target machine and remote user in form of user@target\n"
+ usage
+ exit 1;
+fi
+
+shift
+
+echo "\$target" | grep "@" 2>&1 > /dev/null
+if [ "x\$?" = "x0" ]
+then
+ user=\$(echo \$target | cut -d '@' -f 1)
+ target=\$(echo \$target | cut -d '@' -f 2)
+else
+ user=\$USER
+fi
+ssh \$user@\$target date 2>&1 > /dev/null
+if [ "x\$?" != "x0" ]
+then
+ echo "Failed connecting to \$user@\$target it could be because"
+ echo "you don't have passwordless ssh setup to access \$target"
+ echo "or sometimes host key has been changed"
+ echo "in such case do something like below on build host"
+ echo "ssh-keygen -f "~/.ssh/known_hosts" -R \$target"
+ echo "and then try ssh \$user@\$target"
+
+ usage
+ exit 1
+fi
+ echo "lappend boards_dir [pwd]/../../.." > ${B}/site.exp
+ echo "load_generic_config \"unix\"" > ${B}/${PACKAGE_ARCH}.exp
+ echo "set_board_info username \$user" >> ${B}/${PACKAGE_ARCH}.exp
+ echo "set_board_info rsh_prog ssh" >> ${B}/${PACKAGE_ARCH}.exp
+ echo "set_board_info rcp_prog scp" >> ${B}/${PACKAGE_ARCH}.exp
+ echo "set_board_info hostname \$target" >> ${B}/${PACKAGE_ARCH}.exp
+ DEJAGNU=${B}/site.exp make -k check RUNTESTFLAGS="--target_board=${PACKAGE_ARCH}\$@"
+
+STOP
+
+ chmod +x ${B}/${TARGET_PREFIX}testgcc
+
+}
+
+INHIBIT_PACKAGE_STRIP = "1"
+
+# Compute how to get from libexecdir to bindir in python (easier than shell)
+BINRELPATH = "${@os.path.relpath(d.expand("${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_SYS}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}"
+
+do_install () {
+ ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h )
+ oe_runmake 'DESTDIR=${D}' install-host
+
+ install -d ${D}${target_base_libdir}
+ install -d ${D}${target_libdir}
+
+ # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77
+ # gfortran is fully backwards compatible. This is a safe and practical solution.
+ ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true
+
+
+ # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
+ # found. These need to be relative paths so they work in different locations.
+ dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
+ install -d $dest
+ for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
+ ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
+ ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t
+ done
+
+ # Remove things we don't need but keep share/java
+ for d in info man share/doc share/locale share/man share/info; do
+ rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/$d
+ done
+
+ # libquadmath headers need to be available in the gcc libexec dir
+ install -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+ cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+ cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+
+ # 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-${TARGET_ARCH})
+ dest=${D}/${includedir}/gcc-build-internal-${TARGET_SYS}
+ hardlinkdir . $dest
+ ;;
+ esac
+}
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_4.9.bb
new file mode 100644
index 000000000..b43cca0c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_4.9.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_5.3.bb
new file mode 100644
index 000000000..b43cca0c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-cross_5.3.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc
new file mode 100644
index 000000000..7d2599cb6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc
@@ -0,0 +1,10 @@
+inherit crosssdk
+
+PN = "gcc-crosssdk-initial-${TARGET_ARCH}"
+
+SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include"
+SYSTEMLIBS = "${SDKPATHNATIVE}${base_libdir_nativesdk}/"
+SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk gettext-native ${NATIVEDEPS}"
+PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial-crosssdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.9.bb
new file mode 100644
index 000000000..fd90e1140
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.9.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb
+require gcc-crosssdk-initial.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_5.3.bb
new file mode 100644
index 000000000..fd90e1140
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_5.3.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb
+require gcc-crosssdk-initial.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk.inc
new file mode 100644
index 000000000..53f880f39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk.inc
@@ -0,0 +1,12 @@
+inherit crosssdk
+
+PN = "gcc-crosssdk-${TARGET_ARCH}"
+
+SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include"
+SYSTEMLIBS = "${SDKPATHNATIVE}${base_libdir_nativesdk}/"
+SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/"
+
+GCCMULTILIB = "--disable-multilib"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk virtual/nativesdk-${TARGET_PREFIX}libc-for-gcc gettext-native ${NATIVEDEPS}"
+PROVIDES = "virtual/${TARGET_PREFIX}gcc-crosssdk virtual/${TARGET_PREFIX}g++-crosssdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_4.9.bb
new file mode 100644
index 000000000..40a6c4fef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-crosssdk.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_5.3.bb
new file mode 100644
index 000000000..40a6c4fef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-crosssdk_5.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-crosssdk.inc
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
new file mode 100644
index 000000000..a0a2ac09a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-multilib-config.inc
@@ -0,0 +1,235 @@
+# following code modifies these definitions in the gcc config
+# MULTILIB_OPTIONS
+# MULTILIB_DIRNAMES
+# MULTILIB_OSDIRNAMES
+# GLIBC_DYNAMIC_LINKER32
+# GLIBC_DYNAMIC_LINKER64
+# GLIBC_DYNAMIC_LINKERX32
+# GLIBC_DYNAMIC_LINKERN32
+# For more information on use of these variables look at these files in the gcc source code
+# gcc/config/i386/t-linux64
+# gcc/config/mips/t-linux64
+# gcc/config/rs6000/t-linux64
+# gcc/config/i386/linux64.h
+# gcc/config/mips/linux64.h
+# gcc/config/rs6000/linux64.h
+
+MULTILIB_OPTION_WHITELIST ??= "-m32 -m64 -mx32 -mabi=n32 -mabi=32 -mabi=64"
+
+python gcc_multilib_setup() {
+ import re
+ import shutil
+ import glob
+
+ srcdir = d.getVar('S', True)
+ builddir = d.getVar('B', True)
+ src_conf_dir = '%s/gcc/config' % srcdir
+ build_conf_dir = '%s/gcc/config' % builddir
+
+ bb.utils.remove(build_conf_dir, True)
+ ml_globs = ('%s/*/t-linux64' % src_conf_dir,
+ '%s/*/linux64.h' % src_conf_dir,
+ '%s/aarch64/t-aarch64' % src_conf_dir,
+ '%s/aarch64/aarch64.h' % src_conf_dir,
+ '%s/aarch64/aarch64-cores.def' % src_conf_dir,
+ '%s/*/linux.h' % src_conf_dir,
+ '%s/linux.h' % src_conf_dir)
+
+ # copy the target multilib config files to ${B}
+ for ml_glob in ml_globs:
+ for fn in glob.glob(ml_glob):
+ rel_path = os.path.relpath(fn, src_conf_dir)
+ parent_dir = os.path.dirname(rel_path)
+ 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()
+ if not multilibs and pn != "nativesdk-gcc":
+ return
+
+ mlprefix = d.getVar('MLPREFIX', True)
+
+ if ('%sgcc' % mlprefix) != pn and (not pn.startswith('gcc-cross-canadian')) and pn != "nativesdk-gcc":
+ return
+
+
+ def write_config(root, files, options, dirnames, osdirnames):
+ for ml_conf_file in files:
+ with open(root + '/' + ml_conf_file, 'r') as f:
+ filelines = f.readlines()
+ # recreate multilib configuration variables
+ substs = [
+ (r'^(\s*(MULTILIB_OPTIONS\s*=).*)$', r'\2 %s' % '/'.join(options)),
+ (r'^(\s*MULTILIB_OPTIONS\s*\+=.*)$', ''),
+ (r'^(\s*(MULTILIB_DIRNAMES\s*=).*)$', r'\2 %s' % ' '.join(dirnames)),
+ (r'^(\s*MULTILIB_DIRNAMES\s*\+=.*)$', ''),
+ (r'^(\s*(MULTILIB_OSDIRNAMES\s*=).*)$', r'\2 %s' % ' '.join(osdirnames)),
+ (r'^(\s*MULTILIB_OSDIRNAMES\s*\+=.*)$', ''),
+ ]
+
+ for (i, line) in enumerate(filelines):
+ for subst in substs:
+ line = re.sub(subst[0], subst[1], line)
+ filelines[i] = line
+
+ with open(root + '/' + ml_conf_file, 'w') as f:
+ f.write(''.join(filelines))
+
+ def write_headers(root, files, libdir32, libdir64, libdirx32, libdirn32):
+ def wrap_libdir(libdir):
+ if libdir.find('SYSTEMLIBS_DIR') != -1:
+ return '"%r"'
+ else:
+ return '"/%s/"' % libdir
+
+ for ml_conf_file in files:
+ fn = root + '/' + ml_conf_file
+ if not os.path.exists(fn):
+ continue
+ with open(fn, 'r') as f:
+ filelines = f.readlines()
+
+ # replace lines like
+ # #define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
+ # by
+ # #define GLIBC_DYNAMIC_LINKER32 "/lib/" "ld-linux.so.2"
+ # this is needed to put the correct dynamic loader path in the generated binaries
+ substs = [
+ (r'^(#define\s*GLIBC_DYNAMIC_LINKER32\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdir32) + r'\3'),
+ (r'^(#define\s*GLIBC_DYNAMIC_LINKER64\s*)(\S+)(\s*\"\S+\")$',
+ r'\1' + wrap_libdir(libdir64) + r'\3'),
+ (r'^(#define\s*GLIBC_DYNAMIC_LINKER64\s*\"\S+\"\s*)(\S+)(\s*\"\S+\"\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdir64) + r'\3' + wrap_libdir(libdir64) + r'\5'),
+ (r'^(#define\s*GLIBC_DYNAMIC_LINKERX32\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdirx32) + r'\3'),
+ (r'^(#define\s*GLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdirn32) + r'\3'),
+ (r'^(#define\s*UCLIBC_DYNAMIC_LINKER32\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdir32) + r'\3'),
+ (r'^(#define\s*UCLIBC_DYNAMIC_LINKER64\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdir64) + r'\3'),
+ (r'^(#define\s*UCLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdirn32) + r'\3'),
+ (r'^(#define\s*UCLIBC_DYNAMIC_LINKER\b\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdir32) + r'\3'),
+ ]
+
+ for (i, line) in enumerate(filelines):
+ for subst in substs:
+ line = re.sub(subst[0], subst[1], line)
+ filelines[i] = line
+
+ with open(root + '/' + ml_conf_file, 'w') as f:
+ f.write(''.join(filelines))
+
+
+ gcc_target_config_files = {
+ 'x86_64' : ['gcc/config/i386/t-linux64'],
+ 'i586' : ['gcc/config/i386/t-linux64'],
+ 'i686' : ['gcc/config/i386/t-linux64'],
+ 'mips' : ['gcc/config/mips/t-linux64'],
+ 'mips64' : ['gcc/config/mips/t-linux64'],
+ 'powerpc' : ['gcc/config/rs6000/t-linux64'],
+ 'powerpc64' : ['gcc/config/rs6000/t-linux64'],
+ 'aarch64' : ['gcc/config/aarch64/t-aarch64'],
+ 'arm' : ['gcc/config/aarch64/t-aarch64'],
+ }
+
+ gcc_header_config_files = {
+ 'x86_64' : ['gcc/config/i386/linux64.h'],
+ 'i586' : ['gcc/config/i386/linux64.h'],
+ 'i686' : ['gcc/config/i386/linux64.h'],
+ 'mips' : ['gcc/config/mips/linux.h', 'gcc/config/mips/linux64.h'],
+ 'mips64' : ['gcc/config/mips/linux.h', 'gcc/config/mips/linux64.h'],
+ 'powerpc' : ['gcc/config/rs6000/linux64.h'],
+ 'powerpc64' : ['gcc/config/rs6000/linux64.h'],
+ 'aarch64' : ['gcc/config/aarch64/aarch64.h'],
+ 'arm' : ['gcc/config/aarch64/aarch64.h'],
+ }
+
+ libdir32 = 'SYSTEMLIBS_DIR'
+ libdir64 = 'SYSTEMLIBS_DIR'
+ libdirx32 = 'SYSTEMLIBS_DIR'
+ libdirn32 = 'SYSTEMLIBS_DIR'
+
+
+ target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL', True) if mlprefix
+ else d.getVar('TARGET_ARCH', True))
+ if pn == "nativesdk-gcc":
+ header_config_files = gcc_header_config_files[d.getVar("SDK_ARCH", True)]
+ write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
+ return
+
+ if target_arch not in gcc_target_config_files:
+ bb.warn('gcc multilib setup is not supported for TARGET_ARCH=' + target_arch)
+ return
+
+ target_config_files = gcc_target_config_files[target_arch]
+ header_config_files = gcc_header_config_files[target_arch]
+
+ ml_list = ['DEFAULTTUNE_MULTILIB_ORIGINAL' if mlprefix else 'DEFAULTTUNE']
+ mltunes = [('DEFAULTTUNE_virtclass-multilib-%s' % ml) for ml in multilibs]
+ if mlprefix:
+ mlindex = 0
+ for ml in multilibs:
+ if mlprefix == ml + '-':
+ break
+ mlindex += 1
+
+ ml_list.extend(mltunes[:mlindex] + ['DEFAULTTUNE'] + mltunes[(mlindex + 1):])
+ else:
+ ml_list.extend(mltunes)
+
+ options = []
+ dirnames = []
+ osdirnames = []
+ optsets = []
+
+ for ml in ml_list:
+ tune = d.getVar(ml, True)
+ if not tune:
+ bb.warn("%s doesn't have a corresponding tune. Skipping..." % ml)
+ continue
+ tune_parameters = get_tune_parameters(tune, d)
+
+ tune_baselib = tune_parameters['baselib']
+ if not tune_baselib:
+ bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune)
+ continue
+
+ if tune_baselib == 'lib64':
+ libdir64 = tune_baselib
+ elif tune_baselib == 'libx32':
+ libdirx32 = tune_baselib
+ elif tune_baselib == 'lib32':
+ libdirn32 = tune_baselib
+ elif tune_baselib == 'lib':
+ libdir32 = tune_baselib
+ else:
+ bb.error('Unknown libdir (%s) of the tune : %s' % (tune_baselib, tune))
+
+ # take out '-' mcpu='s and march='s from parameters
+ opts = []
+ whitelist = (d.getVar("MULTILIB_OPTION_WHITELIST", True) or "").split()
+ for i in d.expand(tune_parameters['ccargs']).split():
+ if i in whitelist:
+ # Need to strip '-' from option
+ opts.append(i[1:])
+ options.append(" ".join(opts))
+
+ if tune_baselib == 'lib':
+ dirnames.append('32') # /lib => 32bit lib
+ else:
+ dirnames.append(tune_baselib.replace('lib', ''))
+ osdirnames.append('../' + tune_baselib)
+
+ write_config(builddir, target_config_files, options, dirnames, osdirnames)
+ write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
+}
+
+gcc_multilib_setup[cleandirs] = "${B}/gcc/config"
+gcc_multilib_setup[vardepsexclude] = "SDK_ARCH"
+
+EXTRACONFFUNCS += "gcc_multilib_setup"
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
new file mode 100644
index 000000000..8639c1c49
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -0,0 +1,196 @@
+require gcc-configure-common.inc
+
+# Over-ride the LICENSE set by gcc-${PV}.inc to remove "& GPLv3"
+# All gcc-runtime packages are now covered by the runtime exception.
+LICENSE = "GPL-3.0-with-GCC-exception"
+
+CXXFLAGS_remove = "-fvisibility-inlines-hidden"
+
+EXTRA_OECONF_PATHS = "\
+ --with-gxx-include-dir=${includedir}/c++/${BINV} \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
+
+RUNTIMELIBITM = "libitm"
+RUNTIMELIBITM_mips = ""
+RUNTIMELIBITM_mipsel = ""
+RUNTIMELIBITM_mips64 = ""
+RUNTIMELIBITM_mips64el = ""
+RUNTIMELIBITM_nios2 = ""
+RUNTIMELIBITM_microblaze = ""
+
+RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
+ ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
+"
+
+# ?
+# 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/
+ chmod a+x ${S}/$d/configure
+ relpath=${@os.path.relpath("${S}/$d", "${B}/$target/$d")}
+ $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+ done
+}
+
+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/
+ 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
+ done
+ rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
+ rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
+ rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir
+ 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
+ if [ -d ${D}${infodir} ]; then
+ rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
+ fi
+ if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
+ ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
+ fi
+ if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
+ ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
+ fi
+ chown -R root:root ${D}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
+PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
+
+BBCLASSEXTEND = "nativesdk"
+
+PACKAGES = "\
+ ${PN}-dbg \
+ libstdc++ \
+ libstdc++-precompile-dev \
+ libstdc++-dev \
+ libstdc++-staticdev \
+ libg2c \
+ libg2c-dev \
+ libssp \
+ libssp-dev \
+ libssp-staticdev \
+ libmudflap \
+ libmudflap-dev \
+ libmudflap-staticdev \
+ libquadmath \
+ libquadmath-dev \
+ libquadmath-staticdev \
+ libgomp \
+ libgomp-dev \
+ libgomp-staticdev \
+ libatomic \
+ libatomic-dev \
+ libatomic-staticdev \
+ libitm \
+ libitm-dev \
+ libitm-staticdev \
+"
+
+# The base package doesn't exist, so we clear the recommends.
+RRECOMMENDS_${PN}-dbg = ""
+
+# include python debugging scripts
+FILES_${PN}-dbg += "\
+ ${libdir}/libstdc++.so.*-gdb.py \
+ ${datadir}/gcc-${BINV}/python/libstdcxx \
+"
+
+FILES_libg2c = "${target_libdir}/libg2c.so.*"
+FILES_libg2c-dev = "\
+ ${libdir}/libg2c.so \
+ ${libdir}/libg2c.a \
+ ${libdir}/libfrtbegin.a \
+"
+
+FILES_libstdc++ = "${libdir}/libstdc++.so.*"
+FILES_libstdc++-dev = "\
+ ${includedir}/c++/ \
+ ${libdir}/libstdc++.so \
+ ${libdir}/libstdc++*.la \
+ ${libdir}/libsupc++.la \
+"
+FILES_libstdc++-staticdev = "\
+ ${libdir}/libstdc++*.a \
+ ${libdir}/libsupc++.a \
+"
+
+FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
+
+FILES_libssp = "${libdir}/libssp.so.*"
+FILES_libssp-dev = "\
+ ${libdir}/libssp*.so \
+ ${libdir}/libssp*_nonshared.a \
+ ${libdir}/libssp*.la \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
+"
+FILES_libssp-staticdev = "${libdir}/libssp*.a"
+
+FILES_libquadmath = "${libdir}/libquadmath*.so.*"
+FILES_libquadmath-dev = "\
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
+ ${libdir}/libquadmath*.so \
+ ${libdir}/libquadmath.la \
+"
+FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
+
+FILES_libmudflap = "${libdir}/libmudflap*.so.*"
+FILES_libmudflap-dev = "\
+ ${libdir}/libmudflap*.so \
+ ${libdir}/libmudflap.la \
+"
+FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
+
+FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
+FILES_libgomp-dev = "\
+ ${libdir}/libgomp*${SOLIBSDEV} \
+ ${libdir}/libgomp*.la \
+ ${libdir}/libgomp.spec \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
+"
+FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
+
+FILES_libatomic = "${libdir}/libatomic.so.*"
+FILES_libatomic-dev = "\
+ ${libdir}/libatomic.so \
+ ${libdir}/libatomic.la \
+"
+FILES_libatomic-staticdev = "${libdir}/libatomic.a"
+
+FILES_libitm = "${libdir}/libitm.so.*"
+FILES_libitm-dev = "\
+ ${libdir}/libitm.so \
+ ${libdir}/libitm.la \
+ ${libdir}/libitm.spec \
+"
+FILES_libitm-staticdev = "${libdir}/libitm.a"
+
+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_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_4.9.bb
new file mode 100644
index 000000000..497d69168
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_4.9.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-runtime.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_5.3.bb
new file mode 100644
index 000000000..8f31e7792
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-runtime_5.3.bb
@@ -0,0 +1,7 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-runtime.inc
+
+FILES_libgomp-dev += "\
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \
+"
+
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
new file mode 100644
index 000000000..6091a0b6f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc
@@ -0,0 +1,110 @@
+require gcc-configure-common.inc
+
+LICENSE = "NCSA | MIT"
+
+LIC_FILES_CHKSUM = "\
+ file://libsanitizer/LICENSE.TXT;md5=0249c37748936faf5b1efd5789587909 \
+"
+
+EXTRA_OECONF_PATHS = "\
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+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/
+ chmod a+x ${S}/libsanitizer/configure
+ relpath=${@os.path.relpath("${S}/libsanitizer", "${B}/$target/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
+ # 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
+}
+
+do_compile () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/$target/libsanitizer/
+ oe_runmake MULTIBUILDTOP=${B}/$target/libsanitizer/
+}
+
+do_install () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/$target/libsanitizer/
+ oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/libsanitizer/ install
+ if [ -d ${D}${infodir} ]; then
+ rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
+ fi
+ chown -R root:root ${D}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+ALLOW_EMPTY_${PN} = "1"
+DEPENDS = "gcc-runtime"
+
+BBCLASSEXTEND = "nativesdk"
+
+PACKAGES = "${PN} ${PN}-dbg"
+PACKAGES += "libasan libubsan liblsan libtsan"
+PACKAGES += "libasan-dev libubsan-dev liblsan-dev libtsan-dev"
+PACKAGES += "libasan-staticdev libubsan-staticdev liblsan-staticdev libtsan-staticdev"
+
+RDEPENDS_libasan += "libstdc++"
+RDEPENDS_libubsan += "libstdc++"
+RDEPENDS_liblsan += "libstdc++"
+RDEPENDS_libtsan += "libstdc++"
+RDEPENDS_libasan-dev += "${PN}"
+RDEPENDS_libubsan-dev += "${PN}"
+RDEPENDS_liblsan-dev += "${PN}"
+RDEPENDS_libtsan-dev += "${PN}"
+RRECOMMENDS_${PN} += "libasan libubsan"
+RRECOMMENDS_${PN}_append_x86-64 = " liblsan libtsan"
+RRECOMMENDS_${PN}_append_x86 = " liblsan"
+
+do_package_write_ipk[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata"
+do_package_write_deb[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata"
+
+# MIPS, aarch64, and SPARC are broken.
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm).*-linux'
+
+FILES_libasan += "${libdir}/libasan.so.*"
+FILES_libasan-dev += "\
+ ${libdir}/libasan_preinit.o \
+ ${libdir}/libasan.so \
+ ${libdir}/libasan.la \
+"
+FILES_libasan-staticdev += "${libdir}/libasan.a"
+
+FILES_libubsan += "${libdir}/libubsan.so.*"
+FILES_libubsan-dev += "\
+ ${libdir}/libubsan.so \
+ ${libdir}/libubsan.la \
+"
+FILES_libubsan-staticdev += "${libdir}/libubsan.a"
+
+FILES_liblsan += "${libdir}/liblsan.so.*"
+FILES_liblsan-dev += "\
+ ${libdir}/liblsan.so \
+ ${libdir}/liblsan.la \
+"
+FILES_liblsan-staticdev += "${libdir}/liblsan.a"
+
+FILES_libtsan += "${libdir}/libtsan.so.*"
+FILES_libtsan-dev += "\
+ ${libdir}/libtsan.so \
+ ${libdir}/libtsan.la \
+"
+FILES_libtsan-staticdev += "${libdir}/libtsan.a"
+
+FILES_${PN} = "${libdir}/*.spec ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/sanitizer/*.h"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb
new file mode 100644
index 000000000..601f66602
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-sanitizers.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_5.3.bb
new file mode 100644
index 000000000..601f66602
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-sanitizers_5.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-sanitizers.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-shared-source.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-shared-source.inc
new file mode 100644
index 000000000..aac4b4931
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-shared-source.inc
@@ -0,0 +1,11 @@
+do_fetch() {
+ :
+}
+do_fetch[noexec] = "1"
+deltask do_unpack
+deltask do_patch
+
+SRC_URI = ""
+
+do_configure[depends] += "gcc-source-${PV}:do_preconfigure"
+do_populate_lic[depends] += "gcc-source-${PV}:do_unpack"
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
new file mode 100644
index 000000000..49bde92c4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source.inc
@@ -0,0 +1,32 @@
+deltask do_configure
+deltask do_compile
+deltask do_install
+deltask do_populate_sysroot
+deltask do_populate_lic
+deltask do_rm_work
+
+inherit nopackages
+
+PN = "gcc-source-${PV}"
+WORKDIR = "${TMPDIR}/work-shared/gcc-${PV}-${PR}"
+SSTATE_SWSPEC = "sstate:gcc::${PV}:${PR}::${SSTATE_VERSION}:"
+
+STAMP = "${STAMPS_DIR}/work-shared/gcc-${PV}-${PR}"
+STAMPCLEAN = "${STAMPS_DIR}/work-shared/gcc-${PV}-*"
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS = ""
+PACKAGES = ""
+
+python do_preconfigure () {
+ import subprocess
+ cmd = d.expand('cd ${S} && PATH=${PATH} gnu-configize')
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ # See 0044-gengtypes.patch, we need to regenerate this file
+ 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)
+}
+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_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_4.9.bb
new file mode 100644
index 000000000..b890fa33e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_4.9.bb
@@ -0,0 +1,4 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require recipes-devtools/gcc/gcc-source.inc
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_5.3.bb
new file mode 100644
index 000000000..b890fa33e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-source_5.3.bb
@@ -0,0 +1,4 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require recipes-devtools/gcc/gcc-source.inc
+
+EXCLUDE_FROM_WORLD = "1"
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
new file mode 100644
index 000000000..b8dabe574
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-target.inc
@@ -0,0 +1,210 @@
+GCCMULTILIB = "--enable-multilib"
+require gcc-configure-common.inc
+
+EXTRA_OECONF_PATHS = "\
+ --with-sysroot=/ \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+ --with-native-system-header-dir=${STAGING_DIR_TARGET}${target_includedir} \
+ --with-gxx-include-dir=${includedir}/c++/${BINV} \
+"
+
+EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
+
+# libcc1 requres gcc_cv_objdump when cross build, but gcc_cv_objdump is
+# set in subdir gcc, so subdir libcc1 can't use it, export it here to
+# fix the problem.
+export gcc_cv_objdump = "${TARGET_PREFIX}objdump"
+
+EXTRA_OECONF_GCC_FLOAT = "${@get_gcc_float_setting(bb, d)}"
+
+PACKAGES = "\
+ ${PN} ${PN}-plugins ${PN}-symlinks \
+ g++ g++-symlinks \
+ cpp cpp-symlinks \
+ g77 g77-symlinks \
+ gfortran gfortran-symlinks \
+ gcov gcov-symlinks \
+ ${PN}-doc \
+ ${PN}-dev \
+ ${PN}-dbg \
+"
+
+FILES_${PN} = "\
+ ${bindir}/${TARGET_PREFIX}gcc* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lto* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto*${SOLIBSDEV} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
+"
+INSANE_SKIP_${PN} += "dev-so"
+
+FILES_${PN}-dev = "\
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/gengtype \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.state \
+"
+FILES_${PN}-symlinks = "\
+ ${bindir}/cc \
+ ${bindir}/gcc \
+ ${bindir}/gccbug \
+"
+
+FILES_${PN}-plugins = "\
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin \
+"
+ALLOW_EMPTY_${PN}-plugins = "1"
+
+FILES_g77 = "\
+ ${bindir}/${TARGET_PREFIX}g77 \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \
+"
+FILES_g77-symlinks = "\
+ ${bindir}/g77 \
+ ${bindir}/f77 \
+"
+FILES_gfortran = "\
+ ${bindir}/${TARGET_PREFIX}gfortran \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \
+"
+FILES_gfortran-symlinks = "\
+ ${bindir}/gfortran \
+ ${bindir}/f95"
+
+FILES_cpp = "\
+ ${bindir}/${TARGET_PREFIX}cpp* \
+ ${base_libdir}/cpp \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1"
+FILES_cpp-symlinks = "${bindir}/cpp"
+
+FILES_gcov = "${bindir}/${TARGET_PREFIX}gcov* \
+ ${bindir}/${TARGET_PREFIX}gcov-tool* \
+"
+FILES_gcov-symlinks = "${bindir}/gcov \
+ ${bindir}/gcov-tool \
+"
+
+FILES_g++ = "\
+ ${bindir}/${TARGET_PREFIX}g++* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \
+"
+FILES_g++-symlinks = "\
+ ${bindir}/c++ \
+ ${bindir}/g++ \
+"
+
+FILES_${PN}-doc = "\
+ ${infodir} \
+ ${mandir} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
+"
+
+do_compile () {
+ oe_runmake all-host
+}
+
+do_install () {
+ oe_runmake 'DESTDIR=${D}' install-host
+
+ # Add unwind.h, it comes from libgcc which we don't want to build again
+ install ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/unwind.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+
+ # 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
+
+ # Cleanup some of the ${libdir}{,exec}/gcc stuff ...
+ rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+ rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+ rm -rf ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/*.la
+ rmdir ${D}${includedir}
+ rm -rf ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
+
+ # Hack around specs file assumptions
+ test -f ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs && sed -i -e '/^*cross_compile:$/ { n; s/1/0/; }' ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs
+
+ # Cleanup manpages..
+ rm -rf ${D}${mandir}/man7
+
+ cd ${D}${bindir}
+
+ # We care about g++ not c++
+ rm -f *c++*
+
+ # We don't care about the gcc-<version> ones for this
+ rm -f *gcc-?.?*
+
+ # We use libiberty from binutils
+ find ${D}${libdir} -name libiberty.a | xargs rm -f
+ find ${D}${libdir} -name libiberty.h | xargs rm -f
+
+ # Not sure why we end up with these but we don't want them...
+ rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
+
+ # Symlinks so we can use these trivially on the target
+ if [ -e ${TARGET_PREFIX}g77 ]; then
+ ln -sf ${TARGET_PREFIX}g77 g77 || true
+ ln -sf g77 f77 || true
+ fi
+ if [ -e ${TARGET_PREFIX}gfortran ]; then
+ ln -sf ${TARGET_PREFIX}gfortran gfortran || true
+ ln -sf gfortran f95 || true
+ fi
+ ln -sf ${TARGET_PREFIX}g++ g++
+ ln -sf ${TARGET_PREFIX}gcc gcc
+ ln -sf ${TARGET_PREFIX}cpp cpp
+ install -d ${D}${base_libdir}
+ ln -sf ${bindir}/${TARGET_PREFIX}cpp ${D}${base_libdir}/cpp
+ ln -sf g++ c++
+ ln -sf gcc cc
+
+ chown -R root:root ${D}
+}
+
+do_install_append () {
+ #
+ # Thefixinc.sh script, run on the gcc's compile phase, looks into sysroot header
+ # files and places the modified files into
+ # {D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed folder. This makes the
+ # build not deterministic. The following code prunes all those headers
+ # except those under include-fixed/linux, *limits.h and README, yielding
+ # the same include-fixed folders no matter what sysroot
+
+ include_fixed="${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed"
+ for f in $(find ${include_fixed} -type f); do
+ case $f in
+ */include-fixed/linux/*)
+ continue
+ ;;
+ */include-fixed/*limits.h)
+ continue
+ ;;
+ */include-fixed/README)
+ continue
+ ;;
+ *)
+ # remove file and directory if empty
+ bbdebug 2 "Pruning $f"
+ rm $f
+ find $(dirname $f) -maxdepth 0 -empty -exec rmdir {} \;
+ ;;
+ esac
+ done
+}
+
+# Installing /usr/lib/gcc/* means we'd have two copies, one from gcc-cross
+# and one from here. These can confuse gcc cross where includes use #include_next
+# and builds track file dependencies (e.g. perl and its makedepends code).
+# For determinism we don't install this ever and rely on the copy from gcc-cross.
+# [YOCTO #7287]
+sysroot_stage_dirs_append () {
+ rm -rf $to${libdir}/gcc
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_4.9.bb
new file mode 100644
index 000000000..a9dc612fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_4.9.bb
@@ -0,0 +1,13 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-target.inc
+
+# http://errors.yoctoproject.org/Errors/Details/20497/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+BBCLASSEXTEND = "nativesdk"
+
+#SYSTEMHEADERS_class-nativesdk = "${@'${target_includedir}'.replace(d.getVar('SDKPATH', True),'%r')}"
+#SYSTEMLIBS_class-nativesdk = "${@'${target_base_libdir}'.replace(d.getVar('SDKPATH', True),'%r')}/"
+#SYSTEMLIBS1_class-nativesdk = "${@'${target_libdir}'.replace(d.getVar('SDKPATH', True),'%r')}/"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_5.3.bb
new file mode 100644
index 000000000..b0a523cae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc_5.3.bb
@@ -0,0 +1,15 @@
+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/libgcc-common.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc
new file mode 100644
index 000000000..dae07e96d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -0,0 +1,145 @@
+BPN = "libgcc"
+
+require gcc-shared-source.inc
+
+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}/
+ cd ${B}/${BPN}
+ chmod a+x ${S}/${BPN}/configure
+ relpath=${@os.path.relpath("${S}/${BPN}", "${B}/${BPN}")}
+ $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+}
+
+do_compile () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/${BPN}
+ oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
+}
+
+do_install () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/${BPN}
+ oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
+
+ # Move libgcc_s into /lib
+ mkdir -p ${D}${base_libdir}
+ if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
+ mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir}
+ else
+ mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
+ fi
+
+ # install the runtime in /usr/lib/ not in /usr/lib/gcc on target
+ # so that cross-gcc can find it in the sysroot
+
+ mv ${D}${libdir}/gcc/* ${D}${libdir}
+ rm -rf ${D}${libdir}/gcc/
+ # unwind.h is installed here which is shipped in gcc-cross
+ # as well as target gcc and they are identical so we dont
+ # ship one with libgcc here
+ rm -rf ${D}${libdir}/${TARGET_SYS}/${BINV}/include
+}
+
+do_install_append_libc-baremetal () {
+ rmdir ${D}${base_libdir}
+}
+
+RDEPENDS_${PN}-dev_libc-baremetal = ""
+
+BBCLASSEXTEND = "nativesdk"
+
+addtask multilib_install after do_install before do_package do_populate_sysroot
+# this makes multilib gcc files findable for target gcc
+# e.g.
+# /usr/lib/i586-pokymllib32-linux/4.7/
+# by creating this symlink to it
+# /usr/lib64/x86_64-poky-linux/4.7/32
+
+fakeroot python do_multilib_install() {
+ import re
+
+ multilibs = d.getVar('MULTILIB_VARIANTS', True)
+ if not multilibs or bb.data.inherits_class('nativesdk', d):
+ return
+
+ binv = d.getVar('BINV', True)
+
+ mlprefix = d.getVar('MLPREFIX', True)
+ if ('%slibgcc' % mlprefix) != d.getVar('PN', True):
+ return
+
+ if mlprefix:
+ orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL', True)
+ orig_tune_params = get_tune_parameters(orig_tune, d)
+ orig_tune_baselib = orig_tune_params['baselib']
+ orig_tune_bitness = orig_tune_baselib.replace('lib', '')
+ if not orig_tune_bitness:
+ orig_tune_bitness = '32'
+
+ src = '../../../' + orig_tune_baselib + '/' + \
+ d.getVar('TARGET_SYS_MULTILIB_ORIGINAL', True) + '/' + binv + '/'
+
+ dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
+ d.getVar('TARGET_SYS', True) + '/' + binv + '/' + orig_tune_bitness
+
+ if os.path.lexists(dest):
+ os.unlink(dest)
+ os.symlink(src, dest)
+ return
+
+
+ for ml in multilibs.split():
+ tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml, True)
+ if not tune:
+ bb.warn('DEFAULTTUNE_virtclass-multilib-%s is not defined. Skipping...' % ml)
+ continue
+
+ tune_parameters = get_tune_parameters(tune, d)
+ tune_baselib = tune_parameters['baselib']
+ if not tune_baselib:
+ bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune)
+ continue
+
+ tune_arch = tune_parameters['arch']
+ tune_bitness = tune_baselib.replace('lib', '')
+ if not tune_bitness:
+ tune_bitness = '32' # /lib => 32bit lib
+
+ src = '../../../' + tune_baselib + '/' + \
+ tune_arch + d.getVar('TARGET_VENDOR', True) + 'ml' + ml + \
+ '-' + d.getVar('TARGET_OS', True) + '/' + binv + '/'
+
+ dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
+ d.getVar('TARGET_SYS', True) + '/' + binv + '/' + tune_bitness
+
+ if os.path.lexists(dest):
+ os.unlink(dest)
+ os.symlink(src, dest)
+}
+
+def get_original_vendoros(d):
+ vendoros = d.expand('${TARGET_VENDOR}-${TARGET_OS}')
+ for suffix in [d.getVar('ABIEXTENSION', True), d.getVar('LIBCEXTENSION', True)]:
+ if suffix and vendoros.endswith(suffix):
+ vendoros = vendoros[:-len(suffix)]
+ return vendoros
+
+ORIG_TARGET_VENDOROS := "${@get_original_vendoros(d)}"
+BASETARGET_SYS = "${TARGET_ARCH}${ORIG_TARGET_VENDOROS}"
+
+addtask extra_symlinks after do_multilib_install before do_package do_populate_sysroot
+fakeroot python do_extra_symlinks() {
+ targetsys = d.getVar('BASETARGET_SYS', True)
+
+ 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)):
+ 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
new file mode 100644
index 000000000..59e8a62e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial.inc
@@ -0,0 +1,19 @@
+require libgcc-common.inc
+
+DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial"
+
+LICENSE = "GPL-3.0-with-GCC-exception"
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}"
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+
+PACKAGES = ""
+
+EXTRA_OECONF += "--disable-shared"
+
+LIBGCCBUILDTREENAME = "gcc-build-internal-initial-"
+
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"
+
+inherit nopackages
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_4.9.bb
new file mode 100644
index 000000000..19f253fce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc-initial.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb
new file mode 100644
index 000000000..19f253fce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-initial_5.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc-initial.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc.inc
new file mode 100644
index 000000000..68377869c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc.inc
@@ -0,0 +1,32 @@
+require libgcc-common.inc
+
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
+
+PACKAGES = "\
+ ${PN} \
+ ${PN}-dev \
+ ${PN}-dbg \
+"
+
+# All libgcc source is marked with the exception.
+#
+LICENSE_${PN} = "GPL-3.0-with-GCC-exception"
+LICENSE_${PN}-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_${PN}-dbg = "GPL-3.0-with-GCC-exception"
+
+
+FILES_${PN}-dev = "\
+ ${base_libdir}/libgcc*.so \
+ ${@base_conditional('BASETARGET_SYS', '${TARGET_SYS}', '', '${libdir}/${BASETARGET_SYS}', d)} \
+ ${libdir}/${TARGET_SYS}/${BINV}* \
+"
+
+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"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+
+INSANE_SKIP_${PN}-dev = "staticdev"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_4.9.bb
new file mode 100644
index 000000000..a5152f28e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_5.3.bb
new file mode 100644
index 000000000..a5152f28e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc_5.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran.inc
new file mode 100644
index 000000000..58ceb2e07
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran.inc
@@ -0,0 +1,75 @@
+require gcc-configure-common.inc
+
+EXTRA_OECONF_PATHS = "\
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+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/
+ chmod a+x ${S}/libgfortran/configure
+ relpath=${@os.path.relpath("${S}/libgfortran", "${B}/$target/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
+}
+
+do_compile () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/$target/libgfortran/
+ oe_runmake MULTIBUILDTOP=${B}/$target/libgfortran/
+}
+
+do_install () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/$target/libgfortran/
+ oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/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
+ if [ -d ${D}${infodir} ]; then
+ rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
+ fi
+ chown -R root:root ${D}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS = "gcc-runtime"
+
+BBCLASSEXTEND = "nativesdk"
+
+PACKAGES = "\
+ ${PN}-dbg \
+ libgfortran \
+ libgfortran-dev \
+ libgfortran-staticdev \
+"
+FILES_${PN} = "${libdir}/libgfortran.so.*"
+FILES_${PN}-dev = "\
+ ${libdir}/libgfortran*.so \
+ ${libdir}/libgfortran.spec \
+ ${libdir}/libgfortran.la \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/libgfortranbegin.* \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/libcaf_single* \
+"
+FILES_${PN}-staticdev = "${libdir}/libgfortran.a"
+
+INSANE_SKIP_${MLPREFIX}libgfortran-dev = "staticdev"
+
+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"
+
+python __anonymous () {
+ f = d.getVar("FORTRAN", True)
+ 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_4.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_4.9.bb
new file mode 100644
index 000000000..71dd8b4bd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_4.9.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgfortran.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_5.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_5.3.bb
new file mode 100644
index 000000000..71dd8b4bd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgfortran_5.3.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgfortran.inc
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.10.1.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.10.1.inc
new file mode 100644
index 000000000..a9267d554
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.10.1.inc
@@ -0,0 +1,9 @@
+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[md5sum] = "b93a2721393e5fa226375b42d567d90b"
+SRC_URI[sha256sum] = "ff14f8050e6484508c73cbfa63731e57901478490ca1672dc0b5e2b03f6af622"
+
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
new file mode 100644
index 000000000..0d28ee4ee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc
@@ -0,0 +1,72 @@
+SUMMARY = "GNU debugger"
+HOMEPAGE = "http://www.gnu.org/software/gdb/"
+LICENSE = "GPLv3+"
+SECTION = "devel"
+DEPENDS = "expat zlib ncurses ${LTTNGUST}"
+
+LTTNGUST = "lttng-ust"
+LTTNGUST_aarch64 = ""
+LTTNGUST_libc-uclibc = ""
+LTTNGUST_mips = ""
+LTTNGUST_mipsel = ""
+LTTNGUST_mips64 = ""
+LTTNGUST_mips64el = ""
+LTTNGUST_mips64n32 = ""
+LTTNGUST_mips64eln32 = ""
+LTTNGUST_sh4 = ""
+LTTNGUST_libc-musl = ""
+
+INC_PR = "r0"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674 \
+ file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6"
+
+inherit autotools texinfo
+
+SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.gz \
+ "
+
+B = "${WORKDIR}/build-${TARGET_SYS}"
+
+EXTRA_OEMAKE = "'SUBDIRS=intl mmalloc libiberty opcodes bfd sim gdb etc utils'"
+
+EXPAT = "--with-expat --with-libexpat-prefix=${STAGING_DIR_HOST}"
+
+EXTRA_OECONF = "--disable-gdbtk --disable-tui --disable-x --disable-werror \
+ --with-curses --disable-multilib --disable-sim \
+ --without-lzma --without-guile \
+ ${GDBPROPREFIX} ${EXPAT} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)} \
+ --disable-rpath \
+ "
+
+PACKAGECONFIG ??= "readline"
+# Use --without-system-readline to compile with readline 5.
+PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,readline"
+PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,python,python python-codecs"
+PACKAGECONFIG[babeltrace] = "--with-babeltrace,--without-babeltrace,babeltrace"
+
+GDBPROPREFIX = "--program-prefix=''"
+
+do_configure () {
+ # override this function to avoid the autoconf/automake/aclocal/autoheader
+ # calls for now
+ (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+ oe_runconf
+}
+
+# we don't want gdb to provide bfd/iberty/opcodes, which instead will override the
+# right bits installed by binutils.
+do_install_append() {
+ rm -rf ${D}${libdir}
+ rm -rf ${D}${includedir}
+ rm -rf ${D}${datadir}/locale
+}
+
+RRECOMMENDS_gdb_append_linux = " glibc-thread-db "
+RRECOMMENDS_gdb_append_linux-gnueabi = " glibc-thread-db "
+RRECOMMENDS_gdbserver_append_linux = " glibc-thread-db "
+RRECOMMENDS_gdbserver_append_linux-gnueabi = " glibc-thread-db "
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
new file mode 100644
index 000000000..6e42af1ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
@@ -0,0 +1,42 @@
+inherit cross-canadian
+inherit python-dir
+
+SUMMARY = "GNU debugger (cross-canadian gdb for ${TARGET_ARCH} target)"
+PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+BPN = "gdb"
+
+DEPENDS = "nativesdk-ncurses nativesdk-expat nativesdk-gettext \
+ virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc"
+
+GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'"
+
+# Overrides PACKAGECONFIG variables in gdb-common.inc
+PACKAGECONFIG ??= "python readline"
+PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,nativesdk-python, \
+ nativesdk-python-core nativesdk-python-lang nativesdk-python-re \
+ nativesdk-python-codecs nativesdk-python-netclient"
+PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,nativesdk-readline"
+
+SSTATE_DUPWHITELIST += "${STAGING_DATADIR}/gdb"
+
+do_configure_prepend() {
+cat > ${WORKDIR}/python << EOF
+#! /bin/sh
+case "\$2" in
+ --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}/" ;;
+ --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
+ --exec-prefix) echo "${exec_prefix}" ;;
+ *) exit 1 ;;
+esac
+exit 0
+EOF
+ chmod +x ${WORKDIR}/python
+}
+
+# we don't want gdb to provide bfd/iberty/opcodes, which instead will override the
+# right bits installed by binutils.
+do_install_append() {
+ rm -rf ${D}${exec_prefix}/lib
+ cross_canadian_bindirlinks
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.10.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.10.1.bb
new file mode 100644
index 000000000..301035940
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.10.1.bb
@@ -0,0 +1,3 @@
+require gdb-common.inc
+require gdb-cross-canadian.inc
+require gdb-${PV}.inc
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
new file mode 100644
index 000000000..2468d2303
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross.inc
@@ -0,0 +1,29 @@
+require gdb-common.inc
+
+DEPENDS = "expat-native ncurses-native"
+
+inherit pythonnative
+
+# Overrides PACKAGECONFIG variables in gdb-common.inc
+PACKAGECONFIG ??= "python readline"
+PACKAGECONFIG[python] = "--with-python=${STAGING_BINDIR_NATIVE}/python-native/python,--without-python,python-native"
+PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,readline-native"
+
+do_compile_prepend() {
+ export BUILD_SYS="${BUILD_SYS}"
+ export HOST_SYS="${HOST_SYS}"
+ export STAGING_LIBDIR="${STAGING_LIBDIR_NATIVE}"
+ export STAGING_INCDIR="${STAGING_INCDIR_NATIVE}"
+}
+
+#EXTRA_OEMAKE += "LDFLAGS='${BUILD_LDFLAGS}'"
+
+GDBPROPREFIX = ""
+
+PN = "gdb-cross-${TARGET_ARCH}"
+BPN = "gdb"
+
+inherit cross
+inherit gettext
+
+datadir .= "/gdb-${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.10.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.10.1.bb
new file mode 100644
index 000000000..3a95cfb03
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.10.1.bb
@@ -0,0 +1,4 @@
+require gdb-cross.inc
+require gdb-${PV}.inc
+
+SRC_URI += "file://0001-make-man-install-relative-to-DESTDIR.patch"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb.inc
new file mode 100644
index 000000000..d9c864dca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb.inc
@@ -0,0 +1,18 @@
+require gdb-common.inc
+
+inherit gettext
+
+SRC_URI += "file://0002-Change-order-of-CFLAGS.patch \
+ file://0003-Add-support-for-Renesas-SH-sh4-architecture.patch \
+ file://0001-Use-exported-definitions-of-SIGRTMIN.patch \
+ file://0001-include-sys-types.h-for-mode_t.patch \
+ file://0001-use-asm-sgidefs.h.patch \
+ file://force-readline-static.patch \
+ file://0001-mips-linux-nat-Define-_ABIO32-if-not-defined.patch \
+ "
+#LDFLAGS_append = " -s"
+#export CFLAGS_append=" -L${STAGING_LIBDIR}"
+
+# cross-canadian must not see this
+PACKAGES =+ "gdbserver"
+FILES_gdbserver = "${bindir}/gdbserver"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of-SIGRTMIN.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of-SIGRTMIN.patch
new file mode 100644
index 000000000..5f0c09693
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-Use-exported-definitions-of-SIGRTMIN.patch
@@ -0,0 +1,54 @@
+From 2f97e89e9e4e5797d0d973e1d05c1f44c46b4912 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 5 Jun 2015 20:21:38 -0700
+Subject: [PATCH] Use exorted definitions of SIGRTMIN
+
+Define W_STOPCODE if not defined already
+
+__SIGRTMIN is internal to glibc and other libcs e.g. musl
+may not provide them
+
+Fixes
+https://sourceware.org/bugzilla/show_bug.cgi?id=13012
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ gdb/linux-nat.c | 4 ++--
+ gdb/nat/linux-nat.h | 4 ++++
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
+index 396c30c..50320ee 100644
+--- a/gdb/linux-nat.c
++++ b/gdb/linux-nat.c
+@@ -4856,10 +4856,10 @@ lin_thread_get_thread_signals (sigset_t *set)
+ fortunately they don't change! */
+
+ if (restart == 0)
+- restart = __SIGRTMIN;
++ restart = SIGRTMIN;
+
+ if (cancel == 0)
+- cancel = __SIGRTMIN + 1;
++ cancel = SIGRTMIN + 1;
+
+ sigaddset (set, restart);
+ sigaddset (set, cancel);
+diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h
+index 83a6d91..efbe0fd 100644
+--- a/gdb/nat/linux-nat.h
++++ b/gdb/nat/linux-nat.h
+@@ -25,4 +25,8 @@
+ instead SIGTRAP with bit 7 set. */
+ #define SYSCALL_SIGTRAP (SIGTRAP | 0x80)
+
++#ifndef W_STOPCODE
++#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
++#endif
++
+ #endif /* LINUX_NAT_H */
+--
+2.1.4
+
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
new file mode 100644
index 000000000..a0292e416
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch
@@ -0,0 +1,30 @@
+From acbee4edacb80b5eeaff2480712fe98e56443997 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] include sys/types.h for mode_t
+
+mode_t is used in target.h, so we need to include sys/types.h to get the
+defintion
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ gdb/gdbserver/target.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
+index 9a40867..aaecab9 100644
+--- a/gdb/gdbserver/target.h
++++ b/gdb/gdbserver/target.h
+@@ -27,6 +27,7 @@
+ #include "target/waitstatus.h"
+ #include "mem-break.h"
+ #include "btrace-common.h"
++#include <sys/types.h>
+
+ struct emit_ops;
+ struct buffer;
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch
new file mode 100644
index 000000000..6996c183b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch
@@ -0,0 +1,28 @@
+From 12b0506951460c3cc37d775478d024db3f95e9d8 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 1/3] make man install relative to DESTDIR
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sim/common/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sim/common/Makefile.in b/sim/common/Makefile.in
+index d49a93b..2121c46 100644
+--- a/sim/common/Makefile.in
++++ b/sim/common/Makefile.in
+@@ -35,7 +35,7 @@ tooldir = $(libdir)/$(target_alias)
+ datarootdir = @datarootdir@
+ datadir = @datadir@
+ mandir = @mandir@
+-man1dir = $(mandir)/man1
++man1dir = $(DESTDIR)$(mandir)/man1
+ infodir = @infodir@
+ includedir = @includedir@
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-mips-linux-nat-Define-_ABIO32-if-not-defined.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-mips-linux-nat-Define-_ABIO32-if-not-defined.patch
new file mode 100644
index 000000000..31739525a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-mips-linux-nat-Define-_ABIO32-if-not-defined.patch
@@ -0,0 +1,37 @@
+From e92f8932ef488de2a56db4299131ce6a4eb170bd 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] mips-linux-nat: Define _ABIO32 if not defined
+
+This helps building gdb on mips64 on musl, since
+musl does not provide sgidefs.h this define is
+only defined when GCC is using o32 ABI, in that
+case gcc emits it as built-in define and hence
+it works ok for mips32
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ gdb/mips-linux-nat.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
+index fd5c705..753f29d 100644
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -46,6 +46,11 @@
+ #define PTRACE_GET_THREAD_AREA 25
+ #endif
+
++/* musl does not define and relies on compiler built-in macros for it */
++#ifndef _ABIO32
++#define _ABIO32 1
++#endif
++
+ /* Assume that we have PTRACE_GETREGS et al. support. If we do not,
+ we'll clear this and use PTRACE_PEEKUSER instead. */
+ static int have_ptrace_regsets = 1;
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-use-asm-sgidefs.h.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-use-asm-sgidefs.h.patch
new file mode 100644
index 000000000..eaec39030
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0001-use-asm-sgidefs.h.patch
@@ -0,0 +1,35 @@
+From 677b5b56135141c0d259e370aacd0e11c810aa15 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>
+---
+ gdb/mips-linux-nat.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
+index a36bb63..fd5c705 100644
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include <sys/ptrace.h>
+ #include <asm/ptrace.h>
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0002-Change-order-of-CFLAGS.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0002-Change-order-of-CFLAGS.patch
new file mode 100644
index 000000000..bccb45fda
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0002-Change-order-of-CFLAGS.patch
@@ -0,0 +1,34 @@
+From 262ccc4fdb2a3df0f16c61a807046964ae7729c9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 02:29:23 +0000
+Subject: [PATCH 2/3] Change order of CFLAGS
+
+Lets us override Werror if need be
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gdb/gdbserver/Makefile.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
+index 1ed2ec8..0cef95b 100644
+--- a/gdb/gdbserver/Makefile.in
++++ b/gdb/gdbserver/Makefile.in
+@@ -131,10 +131,10 @@ CFLAGS = @CFLAGS@
+ CPPFLAGS = @CPPFLAGS@
+
+ # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
+-INTERNAL_CFLAGS_BASE = ${CFLAGS} ${GLOBAL_CFLAGS} \
++INTERNAL_CFLAGS_BASE = ${GLOBAL_CFLAGS} \
+ ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS}
+ INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
+-INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
++INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) ${CFLAGS} -DGDBSERVER
+
+ # LDFLAGS is specifically reserved for setting from the command line
+ # when running make.
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0003-Add-support-for-Renesas-SH-sh4-architecture.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0003-Add-support-for-Renesas-SH-sh4-architecture.patch
new file mode 100644
index 000000000..4a3e22c44
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/0003-Add-support-for-Renesas-SH-sh4-architecture.patch
@@ -0,0 +1,921 @@
+From 407cb13cfb70697f45dfb761304e005e1ecbd0e9 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 3/3] Add support for Renesas SH (sh4) architecture.
+
+gdb (7.4-1~cvs20111117.2) experimental; urgency=low
+ .
+ * Add Renesas SH (sh4) support (Closes: #576242)
+ - Thanks Nobuhiro Iwamatsu, Takashi Yoshii.
+Author: Hector Oron <zumbi@debian.org>
+Bug-Debian: http://bugs.debian.org/576242
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gdb/Makefile.in | 1 +
+ gdb/configure.host | 1 +
+ gdb/sh-linux-tdep.c | 519 +++++++++++++++++++++++++++++++++++
+ gdb/sh-tdep.c | 54 ++--
+ gdb/sh-tdep.h | 49 ++++
+ gdb/testsuite/gdb.asm/asm-source.exp | 5 +
+ gdb/testsuite/gdb.asm/sh.inc | 3 +-
+ gdb/testsuite/gdb.base/annota1.c | 3 +
+ gdb/testsuite/gdb.base/annota3.c | 4 +
+ gdb/testsuite/gdb.base/sigall.c | 3 +
+ gdb/testsuite/gdb.base/signals.c | 4 +
+ 11 files changed, 617 insertions(+), 29 deletions(-)
+
+diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+index 7937801..63baf81 100644
+--- a/gdb/Makefile.in
++++ b/gdb/Makefile.in
+@@ -1707,6 +1707,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 \
++ sh-linux-tdep.c sh-linux-nat.c \
+ sol2-tdep.c \
+ solib-svr4.c \
+ sparc-linux-nat.c sparc-linux-tdep.c \
+diff --git a/gdb/configure.host b/gdb/configure.host
+index d07be4b..b6391c5 100644
+--- a/gdb/configure.host
++++ b/gdb/configure.host
+@@ -150,6 +150,7 @@ powerpc*-*-linux*) gdb_host=linux ;;
+
+ s390*-*-linux*) gdb_host=linux ;;
+
++sh*-*-linux*) gdb_host=linux ;;
+ sh*-*-netbsdelf* | sh*-*-knetbsd*-gnu)
+ gdb_host=nbsd ;;
+ sh*-*-openbsd*) gdb_host=nbsd ;;
+diff --git a/gdb/sh-linux-tdep.c b/gdb/sh-linux-tdep.c
+index 2ff2ee8..1a11262 100644
+--- a/gdb/sh-linux-tdep.c
++++ b/gdb/sh-linux-tdep.c
+@@ -18,14 +18,37 @@
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ #include "defs.h"
++#include "gdbcore.h"
++#include "frame.h"
++#include "frame-base.h"
++#include "frame-unwind.h"
++#include "dwarf2-frame.h"
++#include "value.h"
++#include "regcache.h"
++#include "inferior.h"
+ #include "osabi.h"
+
++#include "reggroups.h"
++#include "arch-utils.h"
++#include "floatformat.h"
+ #include "solib-svr4.h"
+ #include "symtab.h"
++#include "gdb_string.h"
++#include "command.h"
++#include "gdb_assert.h"
+
+ #include "trad-frame.h"
+ #include "tramp-frame.h"
+
++#include <sys/ptrace.h>
++#include <sys/types.h>
++#include <sys/param.h>
++#include <sys/user.h>
++#include <sys/syscall.h>
++
++#include <asm/ptrace.h>
++
++#include "regset.h"
+ #include "glibc-tdep.h"
+ #include "sh-tdep.h"
+ #include "linux-tdep.h"
+@@ -180,9 +203,505 @@ static struct tramp_frame sh_linux_rt_sigreturn_tramp_frame = {
+ sh_linux_rt_sigreturn_init
+ };
+
++/* Recognizing signal handler frames. */
++
++/* GNU/Linux has two flavors of signals. Normal signal handlers, and
++ "realtime" (RT) signals. The RT signals can provide additional
++ information to the signal handler if the SA_SIGINFO flag is set
++ when establishing a signal handler using `sigaction'. It is not
++ unlikely that future versions of GNU/Linux will support SA_SIGINFO
++ for normal signals too. */
++
++/* When the SH Linux kernel calls a signal handler and the
++ SA_RESTORER flag isn't set, the return address points to a bit of
++ code on the stack. This function returns whether the PC appears to
++ be within this bit of code.
++
++ The instruction sequence for normal signals is
++ mov.w 1f,r3
++ trapa #16
++ or r0, r0
++ or r0, r0
++ or r0, r0
++ or r0, r0
++ or r0, r0
++ 1: .word __NR_sigreturn
++ or 0x9305 0xc310 0x200b 0x200b 0x200b 0x200b 0x200b 0x0077.
++
++ Checking for the code sequence should be somewhat reliable, because
++ the effect is to call the system call sigreturn. This is unlikely
++ to occur anywhere other than a signal trampoline.
++
++ It kind of sucks that we have to read memory from the process in
++ order to identify a signal trampoline, but there doesn't seem to be
++ any other way. The PC_IN_SIGTRAMP macro in tm-linux.h arranges to
++ only call us if no function name could be identified, which should
++ be the case since the code is on the stack.
++
++ Detection of signal trampolines for handlers that set the
++ SA_RESTORER flag is in general not possible. Unfortunately this is
++ what the GNU C Library has been doing for quite some time now.
++ However, as of version 2.1.2, the GNU C Library uses signal
++ trampolines (named __restore and __restore_rt) that are identical
++ to the ones used by the kernel. Therefore, these trampolines are
++ supported too. */
++
++#define MOVW(n) (0x9300|((n)-2)) /* Move mem word at PC+n to R3 */
++#define TRAP16 0xc310 /* Syscall w/no args (NR in R3) */
++#define OR_R0_R0 0x200b /* or r0,r0 (insert to avoid hardware bug) */
++
++#define LINUX_SIGTRAMP_INSN0 MOVW(7) /* Move mem word at PC+7 to R3 */
++#define LINUX_SIGTRAMP_INSN1 TRAP16 /* Syscall w/no args (NR in R3) */
++#define LINUX_SIGTRAMP_INSN2 OR_R0_R0 /* or r0,r0 (insert to avoid hardware bug) */
++
++static const unsigned short linux_sigtramp_code[] =
++{
++ LINUX_SIGTRAMP_INSN0,
++ LINUX_SIGTRAMP_INSN1,
++ LINUX_SIGTRAMP_INSN2,
++ LINUX_SIGTRAMP_INSN2,
++ LINUX_SIGTRAMP_INSN2,
++ LINUX_SIGTRAMP_INSN2,
++ LINUX_SIGTRAMP_INSN2,
++ __NR_sigreturn
++};
++
++#define LINUX_SIGTRAMP_LEN (sizeof linux_sigtramp_code)
++
++/* If PC is in a sigtramp routine, return the address of the start of
++ the routine. Otherwise, return 0. */
++
++static CORE_ADDR
++sh_linux_sigtramp_start (struct frame_info *next_frame)
++{
++ CORE_ADDR pc = get_frame_pc (next_frame);
++ gdb_byte buf[LINUX_SIGTRAMP_LEN];
++
++ /* We only recognize a signal trampoline if PC is at the start of
++ one of the three instructions. We optimize for finding the PC at
++ the start, as will be the case when the trampoline is not the
++ first frame on the stack. We assume that in the case where the
++ PC is not at the start of the instruction sequence, there will be
++ a few trailing readable bytes on the stack. */
++
++ if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_SIGTRAMP_LEN))
++ return 0;
++
++ if (buf[0] != LINUX_SIGTRAMP_INSN0)
++ {
++ if (buf[0] != LINUX_SIGTRAMP_INSN1)
++ return 0;
++
++ pc -= 2;
++
++ if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_SIGTRAMP_LEN))
++ return 0;
++ }
++
++ if (memcmp (buf, linux_sigtramp_code, LINUX_SIGTRAMP_LEN) != 0)
++ return 0;
++
++ return pc;
++}
++
++/* This function does the same for RT signals. Here the instruction
++ sequence is
++ mov.w 1f,r3
++ trapa #16
++ or r0, r0
++ or r0, r0
++ or r0, r0
++ or r0, r0
++ or r0, r0
++ 1: .word __NR_rt_sigreturn
++ or 0x9305 0xc310 0x200b 0x200b 0x200b 0x200b 0x200b 0x00ad.
++
++ The effect is to call the system call rt_sigreturn. */
++
++#define LINUX_RT_SIGTRAMP_INSN0 MOVW(7) /* Move mem word at PC+7 to R3 */
++#define LINUX_RT_SIGTRAMP_INSN1 TRAP16 /* Syscall w/no args (NR in R3) */
++#define LINUX_RT_SIGTRAMP_INSN2 OR_R0_R0 /* or r0,r0 (insert to avoid hardware bug) */
++
++static const unsigned short linux_rt_sigtramp_code[] =
++{
++ LINUX_RT_SIGTRAMP_INSN0,
++ LINUX_RT_SIGTRAMP_INSN1,
++ LINUX_RT_SIGTRAMP_INSN2,
++ LINUX_RT_SIGTRAMP_INSN2,
++ LINUX_RT_SIGTRAMP_INSN2,
++ LINUX_RT_SIGTRAMP_INSN2,
++ LINUX_RT_SIGTRAMP_INSN2,
++ __NR_rt_sigreturn
++};
++
++#define LINUX_RT_SIGTRAMP_LEN (sizeof linux_rt_sigtramp_code)
++
++/* If PC is in a RT sigtramp routine, return the address of the start
++ of the routine. Otherwise, return 0. */
++
++static CORE_ADDR
++sh_linux_rt_sigtramp_start (struct frame_info *next_frame)
++{
++ CORE_ADDR pc = get_frame_pc (next_frame);
++ gdb_byte buf[LINUX_RT_SIGTRAMP_LEN];
++
++ /* We only recognize a signal trampoline if PC is at the start of
++ one of the two instructions. We optimize for finding the PC at
++ the start, as will be the case when the trampoline is not the
++ first frame on the stack. We assume that in the case where the
++ PC is not at the start of the instruction sequence, there will be
++ a few trailing readable bytes on the stack. */
++
++ if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_RT_SIGTRAMP_LEN))
++ return 0;
++
++ if (buf[0] != LINUX_RT_SIGTRAMP_INSN0)
++ {
++ if (buf[0] != LINUX_RT_SIGTRAMP_INSN1)
++ return 0;
++
++ pc -= 2;
++
++ if (!safe_frame_unwind_memory (next_frame, pc, buf,
++ LINUX_RT_SIGTRAMP_LEN))
++ return 0;
++ }
++
++ if (memcmp (buf, linux_rt_sigtramp_code, LINUX_RT_SIGTRAMP_LEN) != 0)
++ return 0;
++
++ return pc;
++}
++
++/* Return whether PC is in a GNU/Linux sigtramp routine. */
++
++static int
++sh_linux_sigtramp_p (struct frame_info *this_frame)
++{
++ CORE_ADDR pc = get_frame_pc (this_frame);
++ char *name;
++
++ find_pc_partial_function (pc, &name, NULL, NULL);
++
++ /* If we have NAME, we can optimize the search. The trampolines are
++ named __restore and __restore_rt. However, they aren't dynamically
++ exported from the shared C library, so the trampoline may appear to
++ be part of the preceding function. This should always be sigaction,
++ __sigaction, or __libc_sigaction (all aliases to the same function). */
++ if (name == NULL || strstr (name, "sigaction") != NULL)
++ return (sh_linux_sigtramp_start (this_frame) != 0
++ || sh_linux_rt_sigtramp_start (this_frame) != 0);
++
++ return (strcmp ("__restore", name) == 0
++ || strcmp ("__restore_rt", name) == 0);
++}
++
++/* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>. */
++#define SH_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 12
++
++
++/* Assuming NEXT_FRAME is a frame following a GNU/Linux sigtramp
++ routine, return the address of the associated sigcontext structure. */
++
++static CORE_ADDR
++sh_linux_sigcontext_addr (struct frame_info *this_frame)
++{
++ CORE_ADDR pc;
++ CORE_ADDR sp;
++
++ sp = get_frame_register_unsigned (this_frame, SP_REGNUM);
++
++ pc = sh_linux_sigtramp_start (this_frame);
++ if (pc)
++ {
++ return sp;
++ }
++
++ pc = sh_linux_rt_sigtramp_start (this_frame);
++ if (pc)
++ {
++ CORE_ADDR ucontext_addr;
++
++ /* The sigcontext structure is part of the user context. A
++ pointer to the user context is passed as the third argument
++ to the signal handler. */
++ ucontext_addr = get_frame_register_unsigned (this_frame, ARG0_REGNUM+2);
++ return ucontext_addr + SH_LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
++ }
++
++ error ("Couldn't recognize signal trampoline.");
++ return 0;
++}
++
++/* Signal trampolines. */
++extern struct sh_frame_cache *sh_alloc_frame_cache (void);
++
++static struct sh_frame_cache *
++sh_linux_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
++{
++ struct sh_frame_cache *cache;
++ struct gdbarch_tdep *tdep = gdbarch_tdep (get_current_arch ());
++ CORE_ADDR sigcontext_addr;
++
++ if (*this_cache)
++ return *this_cache;
++
++ cache = sh_alloc_frame_cache ();
++
++ cache->base = get_frame_register_unsigned (this_frame, SP_REGNUM);
++ sigcontext_addr = tdep->sigcontext_addr (this_frame);
++ if (tdep->sc_reg_offset)
++ {
++ int i;
++
++ gdb_assert (tdep->sc_num_regs <= SH_NUM_REGS);
++
++ for (i = 0; i < tdep->sc_num_regs; i++)
++ if (tdep->sc_reg_offset[i] != -1)
++ cache->saved_regs[i] = sigcontext_addr + tdep->sc_reg_offset[i];
++ }
++
++ *this_cache = cache;
++ return cache;
++}
++
++static void
++sh_linux_sigtramp_frame_this_id (struct frame_info *this_frame, void **this_cache,
++ struct frame_id *this_id)
++{
++ struct sh_frame_cache *cache =
++ sh_linux_sigtramp_frame_cache (this_frame, this_cache);
++
++ (*this_id) = frame_id_build (cache->base + 64, cache->pc);
++}
++
++extern struct value * sh_frame_prev_register ();
++static struct value *
++sh_linux_sigtramp_frame_prev_register (struct frame_info *this_frame,
++ void **this_cache, int regnum)
++{
++ sh_linux_sigtramp_frame_cache (this_frame, this_cache);
++
++ return sh_frame_prev_register (this_frame, this_cache, regnum);
++}
++
++static int
++sh_linux_sigtramp_frame_sniffer (const struct frame_unwind *self,
++ struct frame_info *this_frame,
++ void **this_prologue_cache)
++{
++ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame));
++
++ /* We shouldn't even bother if we don't have a sigcontext_addr
++ handler. */
++ if (tdep->sigcontext_addr == NULL)
++ return 0;
++
++ if (tdep->sigtramp_p != NULL)
++ {
++ if (tdep->sigtramp_p (this_frame))
++ return 1;
++ }
++
++ return 0;
++}
++
++static const struct frame_unwind sh_linux_sigtramp_frame_unwind =
++{
++ SIGTRAMP_FRAME,
++ sh_linux_sigtramp_frame_this_id,
++ sh_linux_sigtramp_frame_prev_register,
++ NULL,
++ sh_linux_sigtramp_frame_sniffer
++};
++
++/* Supply register REGNUM from the buffer specified by GREGS and LEN
++ in the general-purpose register set REGSET to register cache
++ REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
++
++void
++sh_supply_gregset (const struct regset *regset, struct regcache *regcache,
++ int regnum, const void *gregs, size_t len)
++{
++ const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
++ const char *regs = gregs;
++ int i;
++
++ gdb_assert (len == tdep->sizeof_gregset);
++
++ for (i = 0; i < tdep->gregset_num_regs; i++)
++ {
++ if ((regnum == i || regnum == -1)
++ && tdep->gregset_reg_offset[i] != -1)
++ regcache_raw_supply (regcache, i, regs + tdep->gregset_reg_offset[i]);
++ }
++}
++
++/* Collect register REGNUM from the register cache REGCACHE and store
++ it in the buffer specified by GREGS and LEN as described by the
++ general-purpose register set REGSET. If REGNUM is -1, do this for
++ all registers in REGSET. */
++
++void
++sh_collect_gregset (const struct regset *regset,
++ const struct regcache *regcache,
++ int regnum, void *gregs, size_t len)
++{
++ const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
++ char *regs = gregs;
++ int i;
++
++ gdb_assert (len == tdep->sizeof_gregset);
++
++ for (i = 0; i < tdep->gregset_num_regs; i++)
++ {
++ if ((regnum == i || regnum == -1)
++ && tdep->gregset_reg_offset[i] != -1)
++ regcache_raw_collect (regcache, i, regs + tdep->gregset_reg_offset[i]);
++ }
++}
++
++/* Supply register REGNUM from the buffer specified by FPREGS and LEN
++ in the floating-point register set REGSET to register cache
++ REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
++
++static void
++sh_supply_fpregset (const struct regset *regset, struct regcache *regcache,
++ int regnum, const void *fpregs, size_t len)
++{
++ const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
++ const char *regs = fpregs;
++ int i;
++
++ gdb_assert (len == tdep->sizeof_fpregset);
++ for (i = 0; i < 16; i++)
++ {
++ if (regnum == i+25 || regnum == -1)
++ regcache_raw_supply (regcache, i+25, regs + i*4);
++ }
++ if (regnum == FPSCR_REGNUM || regnum == -1)
++ regcache_raw_supply (regcache, FPSCR_REGNUM, regs + 32*4);
++ if (regnum == FPUL_REGNUM || regnum == -1)
++ regcache_raw_supply (regcache, FPUL_REGNUM, regs + 33*4);
++}
++
++/* Collect register REGNUM from the register cache REGCACHE and store
++ it in the buffer specified by FPREGS and LEN as described by the
++ floating-point register set REGSET. If REGNUM is -1, do this for
++ all registers in REGSET. */
++
++static void
++sh_collect_fpregset (const struct regset *regset,
++ const struct regcache *regcache,
++ int regnum, void *fpregs, size_t len)
++{
++ const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
++ char *regs = fpregs;
++ int i;
++
++ gdb_assert (len == tdep->sizeof_fpregset);
++ for (i = 0; i < 16; i++)
++ {
++ if (regnum == i+25 || regnum == -1)
++ regcache_raw_collect (regcache, i+25, regs + i*4);
++ }
++ if (regnum == FPSCR_REGNUM || regnum == -1)
++ regcache_raw_collect (regcache, FPSCR_REGNUM, regs + 32*4);
++ if (regnum == FPUL_REGNUM || regnum == -1)
++ regcache_raw_collect (regcache, FPUL_REGNUM, regs + 33*4);
++}
++
++/* Return the appropriate register set for the core section identified
++ by SECT_NAME and SECT_SIZE. */
++
++const struct regset *
++sh_linux_regset_from_core_section (struct gdbarch *gdbarch,
++ const char *sect_name, size_t sect_size)
++{
++ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
++
++ if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset)
++ {
++ if (tdep->gregset == NULL)
++ tdep->gregset = regset_alloc (gdbarch, sh_supply_gregset,
++ sh_collect_gregset);
++ return tdep->gregset;
++ }
++
++ if ((strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset))
++ {
++ if (tdep->fpregset == NULL)
++ tdep->fpregset = regset_alloc (gdbarch, sh_supply_fpregset,
++ sh_collect_fpregset);
++ return tdep->fpregset;
++ }
++
++ return NULL;
++}
++
++/* The register sets used in GNU/Linux ELF core-dumps are identical to
++ the register sets in `struct user' that are used for a.out
++ core-dumps. These are also used by ptrace(2). The corresponding
++ types are `elf_gregset_t' for the general-purpose registers (with
++ `elf_greg_t' the type of a single GP register) and `elf_fpregset_t'
++ for the floating-point registers.
++
++ Those types used to be available under the names `gregset_t' and
++ `fpregset_t' too, and GDB used those names in the past. But those
++ names are now used for the register sets used in the `mcontext_t'
++ type, which have a different size and layout. */
++
++/* Mapping between the general-purpose registers in `struct user'
++ format and GDB's register cache layout. */
++
++/* From <sys/reg.h>. */
++static int sh_linux_gregset_reg_offset[] =
++{
++ 0, 4, 8, 12, 16, 20, 24, 28,
++ 32, 36, 40, 44, 48, 52, 56, 60,
++
++ REG_PC*4, REG_PR*4, REG_GBR*4, -1,
++ REG_MACH*4, REG_MACL*4, REG_SR*4,
++};
++
++/* Mapping between the general-purpose registers in `struct
++ sigcontext' format and GDB's register cache layout. */
++
++/* From <asm/sigcontext.h>. */
++static int sh_linux_sc_reg_offset[] =
++{
++ 4, 8, 12, 16, 20, 24, 28, 32,
++ 36, 40, 44, 48, 52, 56, 60, 64,
++ 68, 72, 80, -1,
++ 84, 88, 76
++};
++
+ static void
+ sh_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+ {
++ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
++ bfd abfd;
++
++ tdep->gregset_reg_offset = sh_linux_gregset_reg_offset;
++ tdep->gregset_num_regs = ARRAY_SIZE (sh_linux_gregset_reg_offset);
++ tdep->sizeof_gregset = 23 * 4;
++
++ tdep->jb_pc_offset = 32; /* From <bits/setjmp.h>. */
++
++ tdep->sigtramp_p = sh_linux_sigtramp_p;
++ tdep->sigcontext_addr = sh_linux_sigcontext_addr;
++ tdep->sc_reg_offset = sh_linux_sc_reg_offset;
++ tdep->sc_num_regs = ARRAY_SIZE (sh_linux_sc_reg_offset);
++
++ frame_unwind_append_unwinder(gdbarch, &sh_linux_sigtramp_frame_unwind);
++
++ /* If we have a register mapping, enable the generic core file
++ support, unless it has already been enabled. */
++ if (tdep->gregset_reg_offset
++ && !gdbarch_regset_from_core_section_p (gdbarch))
++ set_gdbarch_regset_from_core_section (gdbarch,
++ sh_linux_regset_from_core_section);
++
+ linux_init_abi (info, gdbarch);
+
+ /* GNU/Linux uses SVR4-style shared libraries. */
+diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
+index 82cf2f4..b443e46 100644
+--- a/gdb/sh-tdep.c
++++ b/gdb/sh-tdep.c
+@@ -21,6 +21,9 @@
+ sac@cygnus.com. */
+
+ #include "defs.h"
++#include "arch-utils.h"
++#include "command.h"
++#include "dummy-frame.h"
+ #include "frame.h"
+ #include "frame-base.h"
+ #include "frame-unwind.h"
+@@ -35,6 +38,7 @@
+ #include "arch-utils.h"
+ #include "floatformat.h"
+ #include "regcache.h"
++#include "regset.h"
+ #include "doublest.h"
+ #include "osabi.h"
+ #include "reggroups.h"
+@@ -67,23 +71,6 @@ static const char *const sh_cc_enum[] = {
+
+ static const char *sh_active_calling_convention = sh_cc_gcc;
+
+-#define SH_NUM_REGS 67
+-
+-struct sh_frame_cache
+-{
+- /* Base address. */
+- CORE_ADDR base;
+- LONGEST sp_offset;
+- CORE_ADDR pc;
+-
+- /* Flag showing that a frame has been created in the prologue code. */
+- int uses_fp;
+-
+- /* Saved registers. */
+- CORE_ADDR saved_regs[SH_NUM_REGS];
+- CORE_ADDR saved_sp;
+-};
+-
+ static int
+ sh_is_renesas_calling_convention (struct type *func_type)
+ {
+@@ -1043,7 +1030,7 @@ sh_treat_as_flt_p (struct type *type)
+ return 0;
+ /* Otherwise if the type of that member is float, the whole type is
+ treated as float. */
+- if (TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) == TYPE_CODE_FLT)
++ if (TYPE_CODE (check_typedef (TYPE_FIELD_TYPE (type, 0))) == TYPE_CODE_FLT)
+ return 1;
+ /* Otherwise it's not treated as float. */
+ return 0;
+@@ -1093,7 +1080,7 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
+ in four registers available. Loop thru args from first to last. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+- type = value_type (args[argnum]);
++ type = check_typedef (value_type (args[argnum]));
+ 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,
+ reg->how = DWARF2_FRAME_REG_UNDEFINED;
+ }
+
+-static struct sh_frame_cache *
++struct sh_frame_cache *
+ sh_alloc_frame_cache (void)
+ {
+ struct sh_frame_cache *cache;
+@@ -1848,7 +1835,7 @@ sh_alloc_frame_cache (void)
+ return cache;
+ }
+
+-static struct sh_frame_cache *
++struct sh_frame_cache *
+ 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)
+ return cache;
+ }
+
+-static struct value *
+-sh_frame_prev_register (struct frame_info *this_frame,
+- void **this_cache, int regnum)
++struct value *
++sh_frame_prev_register (struct frame_info *this_frame, void **this_cache,
++ int regnum)
+ {
+ 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,
+ the current frame. Frob regnum so that we pull the value from
+ the correct place. */
+ if (regnum == gdbarch_pc_regnum (gdbarch))
+- regnum = PR_REGNUM;
++ regnum = PR_REGNUM; /* XXX: really? */
+
+ if (regnum < SH_NUM_REGS && cache->saved_regs[regnum] != -1)
+ return frame_unwind_got_memory (this_frame, regnum,
+@@ -2237,8 +2224,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)
+ {
+- struct gdbarch *gdbarch;
+ struct gdbarch_tdep *tdep;
++ struct gdbarch *gdbarch;
+
+ /* SH5 is handled entirely in sh64-tdep.c. */
+ if (info.bfd_arch_info->mach == bfd_mach_sh5)
+@@ -2254,6 +2241,18 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+ tdep = XCNEW (struct gdbarch_tdep);
+ gdbarch = gdbarch_alloc (&info, tdep);
+
++ /* General-purpose registers. */
++ tdep->gregset = NULL;
++ tdep->gregset_reg_offset = NULL;
++ tdep->gregset_num_regs = 23;
++ tdep->sizeof_gregset = 0;
++
++ /* Floating-point registers. */
++ tdep->fpregset = NULL;
++ tdep->sizeof_fpregset = 34*4;
++
++ tdep->jb_pc_offset = -1;
++
+ 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);
+@@ -2404,10 +2403,11 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+ break;
+ }
+
++ dwarf2_append_unwinders (gdbarch);
++
+ /* Hook in ABI-specific overrides, if they have been registered. */
+ gdbarch_init_osabi (info, gdbarch);
+
+- dwarf2_append_unwinders (gdbarch);
+ frame_unwind_append_unwinder (gdbarch, &sh_stub_unwind);
+ frame_unwind_append_unwinder (gdbarch, &sh_frame_unwind);
+
+diff --git a/gdb/sh-tdep.h b/gdb/sh-tdep.h
+index fc671a5..699f59f 100644
+--- a/gdb/sh-tdep.h
++++ b/gdb/sh-tdep.h
+@@ -21,6 +21,12 @@
+
+ /* Contributed by Steve Chamberlain sac@cygnus.com. */
+
++struct frame_info;
++struct gdbarch;
++struct reggroup;
++struct regset;
++struct regcache;
++
+ /* Registers for all SH variants. Used also by sh3-rom.c. */
+ enum
+ {
+@@ -29,6 +35,7 @@ enum
+ ARG0_REGNUM = 4,
+ ARGLAST_REGNUM = 7,
+ FP_REGNUM = 14,
++ SP_REGNUM = 15,
+ PC_REGNUM = 16,
+ PR_REGNUM = 17,
+ GBR_REGNUM = 18,
+@@ -81,6 +88,24 @@ enum
+ FV0_REGNUM = 76,
+ FV_LAST_REGNUM = 79
+ };
++#define SH_NUM_REGS 67
++
++struct sh_frame_cache
++{
++ /* Base address. */
++ CORE_ADDR base;
++ LONGEST sp_offset;
++ CORE_ADDR pc;
++
++ /* Flag showing that a frame has been created in the prologue code. */
++ int uses_fp;
++
++ /* Saved registers. */
++ CORE_ADDR saved_regs[SH_NUM_REGS];
++ CORE_ADDR saved_sp;
++};
++
++extern struct sh_frame_cache *sh_frame_cache (struct frame_info *next_frame, void **this_cache);
+
+ /* This structure describes a register in a core-file. */
+ struct sh_corefile_regmap
+@@ -89,8 +114,32 @@ struct sh_corefile_regmap
+ unsigned int offset;
+ };
+
++/* sh architecture specific information. */
+ struct gdbarch_tdep
+ {
++ /* General-purpose registers. */
++ struct regset *gregset;
++ int *gregset_reg_offset;
++ int gregset_num_regs;
++ size_t sizeof_gregset;
++
++ /* Floating-point registers. */
++ struct regset *fpregset;
++ size_t sizeof_fpregset;
++
++ /* Offset of saved PC in jmp_buf. */
++ int jb_pc_offset;
++
++ /* Detect sigtramp. */
++ int (*sigtramp_p) (struct frame_info *);
++
++ /* Get address of sigcontext for sigtramp. */
++ CORE_ADDR (*sigcontext_addr) (struct frame_info *);
++
++ /* Offset of registers in `struct sigcontext'. */
++ int *sc_reg_offset;
++ int sc_num_regs;
++
+ /* Non-NULL when debugging from a core file. Provides the offset
+ 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 8854af0..ef44682 100644
+--- a/gdb/testsuite/gdb.asm/asm-source.exp
++++ b/gdb/testsuite/gdb.asm/asm-source.exp
+@@ -113,6 +113,11 @@ switch -glob -- [istarget] {
+ append link-flags " -m elf32ppc"
+ }
+ }
++ "sh*-linux*" {
++ set asm-arch sh-linux
++ set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
++ set debug-flags "-gdwarf-2"
++ }
+ "sh*-*-*" {
+ 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
+--- a/gdb/testsuite/gdb.asm/sh.inc
++++ b/gdb/testsuite/gdb.asm/sh.inc
+@@ -40,9 +40,8 @@
+ mov.l .Lconst\@,r1
+ bra .Lafterconst\@
+ nop
+- nop
+-.Lconst\@:
+ .align 2
++.Lconst\@:
+ .long \subr
+ .align 1
+ .Lafterconst\@:
+diff --git a/gdb/testsuite/gdb.base/annota1.c b/gdb/testsuite/gdb.base/annota1.c
+index 424e1b8..0de2e7b 100644
+--- a/gdb/testsuite/gdb.base/annota1.c
++++ b/gdb/testsuite/gdb.base/annota1.c
+@@ -1,6 +1,9 @@
+ #include <stdio.h>
+ #include <signal.h>
+
++#ifdef __sh__
++#define signal(a,b) /* Signals not supported on this target - make them go away */
++#endif
+
+ void
+ handle_USR1 (int sig)
+diff --git a/gdb/testsuite/gdb.base/annota3.c b/gdb/testsuite/gdb.base/annota3.c
+index 424e1b8..952aaf2 100644
+--- a/gdb/testsuite/gdb.base/annota3.c
++++ b/gdb/testsuite/gdb.base/annota3.c
+@@ -1,6 +1,10 @@
+ #include <stdio.h>
+ #include <signal.h>
+
++#ifdef __sh__
++#define signal(a,b) /* Signals not supported on this target - make them go away */
++#endif
++
+
+ 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
+--- a/gdb/testsuite/gdb.base/sigall.c
++++ b/gdb/testsuite/gdb.base/sigall.c
+@@ -1,6 +1,9 @@
+ #include <signal.h>
+ #include <unistd.h>
+
++#ifdef __sh__
++#define signal(a,b) /* Signals not supported on this target - make them go away */
++#endif
+
+ /* 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
+--- a/gdb/testsuite/gdb.base/signals.c
++++ b/gdb/testsuite/gdb.base/signals.c
+@@ -3,6 +3,10 @@
+ #include <signal.h>
+ #include <unistd.h>
+
++#ifdef __sh__
++#define signal(a,b) /* Signals not supported on this target - make them go away */
++#define alarm(a) /* Ditto for alarm() */
++#endif
+
+ static int count = 0;
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/force-readline-static.patch b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/force-readline-static.patch
new file mode 100644
index 000000000..d34ee8cee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb/force-readline-static.patch
@@ -0,0 +1,37 @@
+If gdb is configured with --disable-static then this is dutifully passed to
+readline which then disables libreadline.a, which causes a problem when gdb
+tries to link against that.
+
+To ensure that readline always builds static libraries, pass --enable-static to
+the sub-configure.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/Makefile.def b/Makefile.def
+index 4394188..05c661a 100644
+--- a/Makefile.def
++++ b/Makefile.def
+@@ -100,7 +100,8 @@ host_modules= { module= libiconv;
+ missing= install-html;
+ missing= install-info; };
+ host_modules= { module= m4; };
+-host_modules= { module= readline; };
++host_modules= { module= readline;
++ extra_configure_flags='--enable-static';};
+ host_modules= { module= sid; };
+ host_modules= { module= sim; };
+ host_modules= { module= texinfo; no_install= true; };
+diff --git a/Makefile.in b/Makefile.in
+index 61e0ab6..837f36e 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -24971,7 +24971,7 @@ configure-readline:
+ $$s/$$module_srcdir/configure \
+ --srcdir=$${topdir}/$$module_srcdir \
+ $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+- --target=${target_alias} \
++ --target=${target_alias} --enable-static \
+ || exit 1
+ @endif readline
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.10.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.10.1.bb
new file mode 100644
index 000000000..f897e1213
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.10.1.bb
@@ -0,0 +1,20 @@
+require gdb.inc
+require gdb-${PV}.inc
+
+inherit python-dir
+
+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}/" ;;
+ --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
+ --exec-prefix) echo "${exec_prefix}" ;;
+ *) exit 1 ;;
+esac
+exit 0
+EOF
+ chmod +x ${WORKDIR}/python
+ fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/git/git.inc b/import-layers/yocto-poky/meta/recipes-devtools/git/git.inc
new file mode 100644
index 000000000..a1d0300be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/git/git.inc
@@ -0,0 +1,127 @@
+SUMMARY = "Distributed version control system"
+HOMEPAGE = "http://git-scm.com"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+DEPENDS = "openssl curl zlib expat"
+
+PROVIDES_append_class-native = " git-replacement-native"
+
+SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \
+ ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages"
+
+S = "${WORKDIR}/git-${PV}"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1"
+
+EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \
+ --without-tcltk \
+"
+
+inherit autotools-brokensep perlnative bash-completion
+
+EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
+EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'"
+EXTRA_OEMAKE_append_class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1"
+
+do_compile_prepend () {
+ # Remove perl/perl.mak to fix the out-of-date perl.mak error
+ # during rebuild
+ rm -f perl/perl.mak
+}
+
+do_install () {
+ oe_runmake install DESTDIR="${D}" bindir=${bindir} \
+ template_dir=${datadir}/git-core/templates \
+ GIT_PYTHON_DIR=${D}${datadir}/git-core/python
+ install -d ${D}/${mandir}/man1
+ install -d ${D}/${mandir}/man5
+ install -d ${D}/${mandir}/man7
+ install -t ${D}/${mandir}/man1 ${WORKDIR}/man1/*
+ install -t ${D}/${mandir}/man5 ${WORKDIR}/man5/*
+ install -t ${D}/${mandir}/man7 ${WORKDIR}/man7/*
+ install -d ${D}/${datadir}/bash-completion/completions/
+ install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git
+}
+
+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) + '/')}
+
+ # ${libdir} is not applicable here, perl-native files are always
+ # installed to /usr/lib on both 32/64 bits targets.
+
+ mkdir -p ${D}${libdir}
+ mv ${D}${exec_prefix}/lib/perl-native/perl ${D}${libdir}
+ rmdir -p ${D}${exec_prefix}/lib/perl-native || true
+}
+
+REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core"
+REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates"
+
+do_install_append_class-target () {
+ perl_native_fixup
+}
+
+do_install_append_class-native() {
+ create_wrapper ${D}${bindir}/git \
+ GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
+ GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
+}
+
+do_install_append_class-nativesdk() {
+ create_wrapper ${D}${bindir}/git \
+ GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
+ GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
+ perl_native_fixup
+}
+
+FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/"
+
+PERLTOOLS = " \
+ ${libexecdir}/git-core/git-add--interactive \
+ ${libexecdir}/git-core/git-archimport \
+ ${libexecdir}/git-core/git-cvsexportcommit \
+ ${libexecdir}/git-core/git-cvsimport \
+ ${libexecdir}/git-core/git-cvsserver \
+ ${bindir}/git-cvsserver \
+ ${libexecdir}/git-core/git-difftool \
+ ${libexecdir}/git-core/git-relink \
+ ${libexecdir}/git-core/git-send-email \
+ ${libexecdir}/git-core/git-svn \
+ ${libexecdir}/git-core/git-instaweb \
+ ${libexecdir}/git-core/git-submodule \
+ ${libexecdir}/git-core/git-am \
+ ${libexecdir}/git-core/git-request-pull \
+ ${datadir}/gitweb/gitweb.cgi \
+ ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \
+ ${datadir}/git-core/templates/hooks/pre-rebase.sample \
+"
+
+# Git tools requiring perl
+PACKAGES =+ "${PN}-perltools"
+FILES_${PN}-perltools += " \
+ ${PERLTOOLS} \
+ ${libdir}/perl \
+ ${datadir}/perl \
+"
+RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils"
+
+PACKAGES =+ "${PN}-python"
+FILES_${PN}-python = "${libdir}/python*"
+
+
+# git-tk package with gitk and git-gui
+PACKAGES =+ "${PN}-tk"
+#RDEPENDS_${PN}-tk = "${PN} tk tcl"
+#EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh"
+FILES_${PN}-tk = " \
+ ${bindir}/gitk \
+ ${datadir}/gitk \
+"
+
+PACKAGES =+ "gitweb"
+FILES_gitweb = "${datadir}/gitweb/"
+
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/git/git_2.7.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/git/git_2.7.4.bb
new file mode 100644
index 000000000..bc72793d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/git/git_2.7.4.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] = "c64012d491e24c7d65cd389f75383d91"
+SRC_URI[tarball.sha256sum] = "7104c4f5d948a75b499a954524cb281fe30c6649d8abe20982936f75ec1f275b"
+SRC_URI[manpages.md5sum] = "58020dc13a5801c49f7986fef7027535"
+SRC_URI[manpages.sha256sum] = "0dfe1931ad302873470e0280248e3aa50502b5edd00dcc3e9c9173667b6fea6a"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch
new file mode 100644
index 000000000..2094116f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch
@@ -0,0 +1,170 @@
+Upstream-Status: Pending
+
+Patch courtesy gentoo-portage/sys-devel/gnuconfig/files/automake-1.8.5-config-guess-uclibc.patch.
+
+updated to 20050516 by Marcin 'Hrw' Juszkiewicz (by hand)
+updated to 20080123 by Nitin A Kamble (by hand)
+updated to 20111001 by Saul Wold (by hand)
+updated to 20120818 by Marcin 'Hrw' Juszkiewicz (by hand)
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
+
+---
+ config.guess | 67 +++++++++++++++++++++++++++++++++++------------------------
+ 1 file changed, 40 insertions(+), 27 deletions(-)
+
+--- git.orig/config.guess
++++ git/config.guess
+@@ -138,6 +138,19 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` |
+ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
++# Detect uclibc systems.
++
++LIBC="gnu"
++if [ -f /usr/include/bits/uClibc_config.h ]
++then
++ LIBC=uclibc
++ if [ -n `grep "#define __UCLIBC_CONFIG_VERSION__" /usr/include/bits/uClibc_config.h` ]
++ then
++ UCLIBC_SUBVER=`sed -n "/#define __UCLIBC_CONFIG_VERSION__ /s///p" /usr/include/bits/uClibc_config.h`
++ LIBC=$LIBC$UCLIBC_SUBVER
++ fi
++fi
++
+ # Note: order is significant - the case branches are not exclusive.
+
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+@@ -886,15 +899,15 @@ EOF
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
++ if test "$?" = 0 ; then LIBC="gnulibc1" ; else LIBC="" ; fi
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+@@ -906,19 +919,19 @@ EOF
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ cris:Linux:*:*)
+- echo ${UNAME_MACHINE}-axis-linux-gnu
++ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ crisv32:Linux:*:*)
+- echo ${UNAME_MACHINE}-axis-linux-gnu
++ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ frv:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ hexagon:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+@@ -932,13 +945,13 @@ EOF
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit ;;
+ ia64:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m32r*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m68*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+@@ -957,54 +970,54 @@ EOF
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
++ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ ;;
+ or32:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ padre:Linux:*:*)
+- echo sparc-unknown-linux-gnu
++ echo sparc-unknown-linux-${LIBC}
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+- echo hppa64-unknown-linux-gnu
++ echo hppa64-unknown-linux-${LIBC}
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+- PA7*) echo hppa1.1-unknown-linux-gnu ;;
+- PA8*) echo hppa2.0-unknown-linux-gnu ;;
+- *) echo hppa-unknown-linux-gnu ;;
++ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
++ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
++ *) echo hppa-unknown-linux-${LIBC} ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+- echo powerpc64-unknown-linux-gnu
++ echo powerpc64-unknown-linux-${LIBC}
+ exit ;;
+ ppc:Linux:*:*)
+- echo powerpc-unknown-linux-gnu
++ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sh*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ tile*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ vax:Linux:*:*)
+- echo ${UNAME_MACHINE}-dec-linux-gnu
++ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ exit ;;
+ x86_64:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ xtensa*:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in
new file mode 100755
index 000000000..d4908fc4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in
@@ -0,0 +1,267 @@
+#! /usr/bin/env perl
+# -*- perl -*-
+
+eval 'case $# in 0) exec /usr/bin/perl -S "$0";; *) exec /usr/bin/perl -S "$0" "$@";; esac'
+ if 0;
+
+# gnu-configize - install the GNU config.guess / config.sub in a directory tree
+# Based on autoreconf:
+# Copyright (C) 1994, 1999, 2000, 2001, 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.
+
+BEGIN
+{
+ my $datadir = $ENV{'autom4te_perllibdir'} || '@autom4te_perllibdir@';
+# '/home/kergoth/code/build-arm/tmp/staging/share/autoconf';
+ unshift @INC, $datadir;
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+ # that can handle redirection and quote arguments correctly,
+ # e.g.: COMMAND.COM. For DJGPP always use the shell that configure
+ # has detected.
+ $ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos');
+}
+
+use Autom4te::ChannelDefs;
+use Autom4te::Channels;
+use Autom4te::Configure_ac;
+use Autom4te::FileUtils;
+use Autom4te::General;
+use Autom4te::XFile;
+# Do not use Cwd::chdir, since it might hang.
+use Cwd 'cwd';
+use strict;
+
+## ----------- ##
+## Variables. ##
+## ----------- ##
+
+# $HELP
+# -----
+$help = "Usage: $0 [OPTION] ... [CONFIGURE-AC or DIRECTORY] ...
+
+Install the GNU config.sub and config.guess scripts in the
+DIRECTORIES or the directory trees driven by CONFIGURE-AC
+(defaulting to `.').
+
+Operation modes:
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -v, --verbose verbosely report processing
+ -f, --force consider all files obsolete
+ -s, --symlink install symbolic links instead of copies
+ -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
+
+" . Autom4te::ChannelDefs::usage . "
+
+The environment variable \`WARNINGS\' is honored. Some subtools might
+support other warning types, using \`all' is encouraged.
+";
+
+# $VERSION
+# --------
+$version = "gnu-configize 1.0
+
+Copyright (C) 2004 Chris Larson
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+";
+
+my $configdir = '@gnu-configdir@';
+#'/home/kergoth/code/build-arm/tmp/staging/i686-linux/share/gnu-config';
+my $autoconf = $ENV{'AUTOCONF'} || 'autoconf';
+
+# use symlinks instead.
+my $symlink = 0;
+
+my $configure_ac;
+
+my $rm = "rm -f";
+my $ln_s = "ln -sf";
+my $cp = "cp -f";
+my $mkdir = "mkdir";
+my $chmod = "chmod";
+
+## ---------- ##
+## Routines. ##
+## ---------- ##
+
+
+# parse_args ()
+# -------------
+# Process any command line arguments.
+sub parse_args ()
+{
+ my $srcdir;
+
+ getopt ('s|symlink' => \$symlink);
+
+ # Even if the user specified a configure.ac, trim to get the
+ # directory, and look for configure.ac again. Because (i) the code
+ # is simpler, and (ii) we are still able to diagnose simultaneous
+ # presence of configure.ac and configure.in.
+ @ARGV = map { /configure\.(ac|in)$/ ? dirname ($_) : $_ } @ARGV;
+ push @ARGV, '.' unless @ARGV;
+}
+
+
+# &gnu_configize_current_directory
+# -----------------------------
+sub gnu_configize_current_directory ()
+{
+ my $configure_ac = require_configure_ac;
+
+ # ---------------------- #
+ # Is it using Autoconf? #
+ # ---------------------- #
+
+ my $uses_autoconf;
+ my $uses_gettext;
+ my $configure_ac_file = new Autom4te::XFile $configure_ac;
+ while ($_ = $configure_ac_file->getline)
+ {
+ s/#.*//;
+ s/dnl.*//;
+ $uses_autoconf = 1 if /AC_INIT/;
+ }
+
+ if (!$uses_autoconf)
+ {
+ verb "$configure_ac: not using Autoconf";
+ return;
+ }
+
+ my $aux_dir;
+ my @subdir;
+ my $cmd;
+ my $dest;
+
+ verb "$configure_ac: tracing";
+ my $traces = new Autom4te::XFile
+ ("$autoconf"
+ . join (' --trace=', '',
+ # If you change this list, update the
+ # `Autoreconf-preselections' section of autom4te.in.
+ 'AC_CONFIG_AUX_DIR:AC_CONFIG_AUX_DIR:\$1',
+ 'AC_CONFIG_SUBDIRS:AC_CONFIG_SUBDIRS:\$1',
+ 'AC_INIT',
+ )
+ . ' |');
+ while ($_ = $traces->getline)
+ {
+ $aux_dir = $1 if /AC_CONFIG_AUX_DIR:(.*)/;
+ $uses_autoconf = 1 if /AC_INIT/;
+ push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/;
+ }
+
+ # The subdirs are *optional*, they may not exist.
+ foreach (@subdir)
+ {
+ if (-d)
+ {
+ verb "$configure_ac: subdirectory $_ to gnu-configize";
+ gnu_configize ($_);
+ }
+ else
+ {
+ verb "$configure_ac: subdirectory $_ not present";
+ }
+ }
+
+ $dest = ".";
+
+ if (defined $aux_dir)
+ {
+ $dest = $aux_dir;
+ if (! -d $aux_dir)
+ {
+ verb "$configure_ac: creating directory $aux_dir";
+ mkdir $aux_dir
+ or error "cannot create $aux_dir: $!";
+ }
+ }
+
+ if (!$symlink)
+ {
+ $cmd = $cp;
+ }
+ else
+ {
+ $cmd = $ln_s;
+ }
+
+ xsystem ("$cmd $configdir/config.guess $dest/");
+ xsystem ("$chmod u+x $dest/config.guess");
+ xsystem ("$cmd $configdir/config.sub $dest/");
+ xsystem ("$chmod u+x $dest/config.sub");
+}
+
+
+# &gnu_configize ($DIRECTORY)
+# ------------------------
+# Reconf the $DIRECTORY.
+sub gnu_configize ($)
+{
+ my ($directory) = @_;
+ my $cwd = cwd;
+
+ # The format for this message is not free: taken from Emacs, itself
+ # using GNU Make's format.
+ verb "Entering directory `$directory'";
+ chdir $directory
+ or error "cannot chdir to $directory: $!";
+
+ gnu_configize_current_directory;
+
+ # The format is not free: taken from Emacs, itself using GNU Make's
+ # format.
+ verb "Leaving directory `$directory'";
+ chdir $cwd
+ or error "cannot chdir to $cwd: $!";
+}
+
+
+## ------ ##
+## Main. ##
+## ------ ##
+
+parse_args;
+
+# Autoreconf all the given configure.ac. A while loop, not a for,
+# since the list can change at runtime because of AC_CONFIG_SUBDIRS.
+for my $directory (@ARGV)
+ {
+ gnu_configize ($directory);
+ }
+
+### Setup "GNU" style for perl-mode and cperl-mode.
+## Local Variables:
+## perl-indent-level: 2
+## perl-continued-statement-offset: 2
+## perl-continued-brace-offset: 0
+## perl-brace-offset: 0
+## perl-brace-imaginary-offset: 0
+## perl-label-offset: -2
+## cperl-indent-level: 2
+## cperl-brace-offset: 0
+## cperl-continued-brace-offset: 0
+## cperl-label-offset: -2
+## cperl-extra-newline-before-brace: t
+## cperl-merge-trailing-else: nil
+## cperl-continued-statement-offset: 2
+## End:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch
new file mode 100644
index 000000000..3147435a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch
@@ -0,0 +1,25 @@
+support musl
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: gnu-config-20120814/config.sub
+===================================================================
+--- gnu-config-20120814.orig/config.sub 2012-09-18 02:27:45.000000000 -0700
++++ gnu-config-20120814/config.sub 2014-03-26 00:34:19.955996709 -0700
+@@ -123,6 +123,7 @@
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
++ linux-musl* | \
+ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+@@ -1365,6 +1366,7 @@
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-uclibc* \
++ | -linux-musl* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch
new file mode 100644
index 000000000..75fe10082
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+--- config.sub.orig 2004-05-14 19:38:36.000000000 -0500
++++ config.sub 2004-05-14 19:39:17.000000000 -0500
+@@ -118,7 +118,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
++ nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -1135,7 +1135,8 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -mingw32* | -linux-gnu* | -linux-uclibc* \
++ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb
new file mode 100644
index 000000000..0d05e79fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb
@@ -0,0 +1,41 @@
+SUMMARY = "gnu-configize"
+DESCRIPTION = "Tool that installs the GNU config.guess / config.sub into a directory tree"
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://config.guess;endline=39;md5=b79a4663475f4d724846463277817e0d"
+
+DEPENDS_class-native = "hostperl-runtime-native"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/gnu-config/gnu-config-${PV}.tar.bz2 \
+ file://config-guess-uclibc.patch \
+ file://musl-support.patch \
+ file://gnu-configize.in"
+
+SRC_URI[md5sum] = "bcfca5a2bb39edad4aae5a65efc84094"
+SRC_URI[sha256sum] = "44f99a8e76f3e8e4fec0bb5ad4762f8e44366168554ce66cb85afbe2ed3efd8b"
+
+CLEANBROKEN = "1"
+
+do_compile[noexec] = "1"
+
+do_install () {
+ install -d ${D}${datadir}/gnu-config \
+ ${D}${bindir}
+ cat ${WORKDIR}/gnu-configize.in | \
+ sed -e 's,@gnu-configdir@,${datadir}/gnu-config,g' \
+ -e 's,@autom4te_perllibdir@,${datadir}/autoconf,g' > ${D}${bindir}/gnu-configize
+ # In the native case we want the system perl as perl-native can't have built yet
+ if [ "${PN}" != "gnu-config-native" -a "${PN}" != "nativesdk-gnu-config" ]; then
+ sed -i -e 's,/usr/bin/env,${bindir}/env,g' ${D}${bindir}/gnu-configize
+ fi
+ chmod 755 ${D}${bindir}/gnu-configize
+ install -m 0644 config.guess config.sub ${D}${datadir}/gnu-config/
+}
+
+PACKAGES = "${PN}"
+FILES_${PN} = "${bindir} ${datadir}/gnu-config"
+
+BBCLASSEXTEND = "native nativesdk"
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
new file mode 100644
index 000000000..072726f60
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb
@@ -0,0 +1,40 @@
+SUMMARY = "gnu-configize"
+DESCRIPTION = "Tool that installs the GNU config.guess / config.sub into a directory tree"
+SECTION = "devel"
+LICENSE = "GPL-3.0-with-autoconf-exception"
+LIC_FILES_CHKSUM = "file://config.guess;beginline=7;endline=27;md5=9bac8b1743c2240ae07cce6e546ac2f2"
+
+DEPENDS_class-native = "hostperl-runtime-native"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRCREV = "b576fa87c140b824466ef1638e945e87dc5c0343"
+PV = "20150728+git${SRCPV}"
+
+SRC_URI = "git://git.sv.gnu.org/config.git \
+ file://gnu-configize.in"
+
+S = "${WORKDIR}/git"
+
+CLEANBROKEN = "1"
+
+do_compile[noexec] = "1"
+
+do_install () {
+ install -d ${D}${datadir}/gnu-config \
+ ${D}${bindir}
+ cat ${WORKDIR}/gnu-configize.in | \
+ sed -e 's,@gnu-configdir@,${datadir}/gnu-config,g' \
+ -e 's,@autom4te_perllibdir@,${datadir}/autoconf,g' > ${D}${bindir}/gnu-configize
+ # In the native case we want the system perl as perl-native can't have built yet
+ if [ "${PN}" != "gnu-config-native" -a "${PN}" != "nativesdk-gnu-config" ]; then
+ sed -i -e 's,/usr/bin/env,${bindir}/env,g' ${D}${bindir}/gnu-configize
+ fi
+ chmod 755 ${D}${bindir}/gnu-configize
+ install -m 0644 config.guess config.sub ${D}${datadir}/gnu-config/
+}
+
+PACKAGES = "${PN}"
+FILES_${PN} = "${bindir} ${datadir}/gnu-config"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/0001-libguile-Check-for-strtol_l-during-configure.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/0001-libguile-Check-for-strtol_l-during-configure.patch
new file mode 100644
index 000000000..24f073f9f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/0001-libguile-Check-for-strtol_l-during-configure.patch
@@ -0,0 +1,56 @@
+From 814d6fb6c1f4a544c8fd37f5a390ba020c2d8c85 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 10 Jan 2016 22:28:17 +0000
+Subject: [PATCH] libguile: Check for strtol_l during configure
+
+strtol_l is a gnu extention which may not be available on other linux
+libc implementations e.g. musl. Therefore check for this funciton and
+conditionalize the use of it.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 5 +++--
+ libguile/i18n.c | 2 +-
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3969929..f8a6a1a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -752,7 +752,8 @@ AC_CHECK_HEADERS([assert.h crt_externs.h])
+ # truncate - not in mingw
+ # isblank - available as a GNU extension or in C99
+ # _NSGetEnviron - Darwin specific
+-# strcoll_l, newlocale - GNU extensions (glibc), also available on Darwin
++# strcoll_l, newlocale, strtol_l - GNU extensions (glibc),
++# also available on Darwin
+ # fork - unavailable on Windows
+ # utimensat - posix.1-2008
+ # sched_getaffinity, sched_setaffinity - GNU extensions (glibc)
+@@ -768,7 +769,7 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid \
+ getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp \
+ index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron \
+ strcoll strcoll_l newlocale utimensat sched_getaffinity \
+- sched_setaffinity sendfile])
++ sched_setaffinity sendfile strtol_l])
+
+ AM_CONDITIONAL([BUILD_ICE_9_POPEN],
+ [test "x$enable_posix" = "xyes" && test "x$ac_cv_func_fork" = "xyes"])
+diff --git a/libguile/i18n.c b/libguile/i18n.c
+index 97d44b0..9fb6976 100644
+--- a/libguile/i18n.c
++++ b/libguile/i18n.c
+@@ -1352,7 +1352,7 @@ SCM_DEFINE (scm_locale_string_to_integer, "locale-string->integer",
+
+ if (c_locale != NULL)
+ {
+-#ifdef USE_GNU_LOCALE_API
++#if defined(USE_GNU_LOCALE_API) && defined(HAVE_STRTOL_L)
+ c_result = strtol_l (c_str, &c_endptr, c_base, c_locale);
+ #else
+ RUN_IN_LOCALE_SECTION (c_locale,
+--
+2.7.0
+
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
new file mode 100644
index 000000000..519585b8e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/0002-Recognize-nios2-as-compilation-target.patch
@@ -0,0 +1,36 @@
+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
+index d60a8e0..d1f6cff 100644
+--- 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"))
++ "powerpcle" "powerpc64le" "mipsel" "mips64el" "nios2"))
+ (endianness little))
+ ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
+ "mips" "mips64"))
+@@ -100,7 +100,7 @@
+
+ ((string-match "64$" cpu) 8)
+ ((string-match "64[lbe][lbe]$" cpu) 8)
+- ((member cpu '("sparc" "powerpc" "mips" "mipsel")) 4)
++ ((member cpu '("sparc" "powerpc" "mips" "mipsel" "nios2")) 4)
+ ((string-match "^arm.*" cpu) 4)
+ (else (error "unknown CPU word size" cpu)))))
+
+--
+2.7.0.rc3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_aarch64.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_aarch64.patch
new file mode 100644
index 000000000..f1788b62f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_aarch64.patch
@@ -0,0 +1,19 @@
+guile: add aarch64 recognition
+
+Assume little-endian.
+
+Upstream-Status: Pending
+
+Signed-off-by: joe.slater@windriver.com
+
+--- a/module/system/base/target.scm
++++ b/module/system/base/target.scm
+@@ -70,6 +70,8 @@
+ ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
+ "mips" "mips64"))
+ (endianness big))
++ ((string-match "^aarch64" cpu)
++ (endianness little))
+ ((string-match "^arm.*eb" cpu)
+ (endianness big))
+ ((string-match "^arm.*" cpu)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_endianness.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_endianness.patch
new file mode 100644
index 000000000..ea4328b81
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/arm_endianness.patch
@@ -0,0 +1,23 @@
+Support form ARM endianness
+
+Fixes Yocto bug# 2729
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+Index: guile-2.0.5/module/system/base/target.scm
+===================================================================
+--- guile-2.0.5.orig/module/system/base/target.scm 2012-01-24 03:06:06.000000000 -0800
++++ guile-2.0.5/module/system/base/target.scm 2012-07-12 13:05:44.372364103 -0700
+@@ -70,7 +70,9 @@
+ ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
+ "mips" "mips64"))
+ (endianness big))
+- ((string-match "^arm.*el" cpu)
++ ((string-match "^arm.*eb" cpu)
++ (endianness big))
++ ((string-match "^arm.*" cpu)
+ (endianness little))
+ (else
+ (error "unknown CPU endianness" cpu)))))
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch
new file mode 100644
index 000000000..43238a7d2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [debian patch]
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+From e52bfcdbaca5dce498678d8f512381e3e39a4066 Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Sun, 18 Mar 2012 11:40:55 -0500
+Subject: Mark "Unused modules are removed" gc test as unresolved.
+
+As per discussion with upstream, mark this test as unresolved since it
+may produce false negatives, depending on the behavior/timing of the
+garbage collector.
+---
+ test-suite/tests/gc.test | 11 ++++++-----
+ 1 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/test-suite/tests/gc.test b/test-suite/tests/gc.test
+index a969752..8c8e13e 100644
+--- a/test-suite/tests/gc.test
++++ b/test-suite/tests/gc.test
+@@ -84,11 +84,13 @@
+ ;; one gc round. not sure why.
+
+ (maybe-gc-flakiness
+- (= (let lp ((i 0))
+- (if (guard)
+- (lp (1+ i))
+- i))
+- total))))
++ (or (= (let lp ((i 0))
++ (if (guard)
++ (lp (1+ i))
++ i))
++ total)
++ (throw 'unresolved)))))
++
+
+ (pass-if "Lexical vars are collectable"
+ (let ((l (compile
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch
new file mode 100644
index 000000000..34be3b96e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Inappropriate [debian patch]
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+From 848543091d55dddb54a85612155964506d712852 Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Sun, 18 Mar 2012 13:28:24 -0500
+Subject: Mark "mutex with owner not retained" threads test as unresolved.
+
+As per discussion with upstream, mark this test as unresolved since it
+may produce false negatives, depending on the behavior/timing of the
+garbage collector.
+---
+ test-suite/tests/threads.test | 6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/test-suite/tests/threads.test b/test-suite/tests/threads.test
+index 85a7c38..50899cb 100644
+--- a/test-suite/tests/threads.test
++++ b/test-suite/tests/threads.test
+@@ -414,8 +414,10 @@
+
+ (gc) (gc)
+ (let ((m (g)))
+- (and (mutex? m)
+- (eq? (mutex-owner m) (current-thread)))))))
++ (or
++ (and (mutex? m)
++ (eq? (mutex-owner m) (current-thread)))
++ (throw 'unresolved))))))
+
+ ;;
+ ;; mutex lock levels
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/guile_2.0.6_fix_sed_error.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/guile_2.0.6_fix_sed_error.patch
new file mode 100644
index 000000000..e5dc22637
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/guile_2.0.6_fix_sed_error.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Pending
+
+This fixes sed issue when prefix has / in it, like /usr/local
+
+autoreconf error avoided:
+| sed: -e expression #1, char 9: unknown option to `s'
+| configure.ac:39: error: AC_INIT should be called with package and version arguments
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/01
+
+Index: guile-2.0.5/build-aux/git-version-gen
+===================================================================
+--- guile-2.0.5.orig/build-aux/git-version-gen
++++ guile-2.0.5/build-aux/git-version-gen
+@@ -187,7 +187,7 @@ else
+ v=UNKNOWN
+ fi
+
+-v=`echo "$v" |sed "s/^$prefix//"`
++v=`echo "$v" |sed "s#^$prefix##"`
+
+ # Test whether to append the "-dirty" suffix only if the version
+ # string we're using came from git. I.e., skip the test if it's "UNKNOWN"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-Makefile.am-hook.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-Makefile.am-hook.patch
new file mode 100644
index 000000000..290b9d447
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-Makefile.am-hook.patch
@@ -0,0 +1,42 @@
+From 9c4e120a7a87db34d22a50883a5a525170b480d7 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 6 Jan 2015 23:10:51 -0800
+Subject: [PATCH] libguile/Makefile.am: install-data-hook -> install-exec-hook
+
+It may install such a file:
+/usr/lib64/libguile-2.0*-gdb.scm
+
+This is because when there is no file in the directory:
+for f in libguile-2.0*; do
+ [snip]
+done
+
+The f would be libguile-2.0* itself, use install-exec-hook will fix the
+problem since it depends on install-libLTLIBRARIES.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ libguile/Makefile.am | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/libguile/Makefile.am b/libguile/Makefile.am
+index 5decd99..52645b7 100644
+--- a/libguile/Makefile.am
++++ b/libguile/Makefile.am
+@@ -446,10 +446,8 @@ EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h \
+ ## delete guile-snarf.awk from the installation bindir, in case it's
+ ## lingering there due to an earlier guile version not having been
+ ## wiped out.
+-install-exec-hook:
++install-exec-hook: libguile-2.0-gdb.scm
+ rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
+-
+-install-data-hook: libguile-2.0-gdb.scm
+ @$(MKDIR_P) $(DESTDIR)$(libdir)
+ ## We want to install libguile-2.0-gdb.scm as SOMETHING-gdb.scm.
+ ## SOMETHING is the full name of the final library. We want to ignore
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch
new file mode 100644
index 000000000..e50059a7e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch
@@ -0,0 +1,43 @@
+From a85c78ea1393985fdb6e6678dea19135c553d341 Mon Sep 17 00:00:00 2001
+From: Mark H Weaver <mhw@netris.org>
+Date: Fri, 19 Sep 2014 21:18:09 -0400
+Subject: [PATCH] VM: ASM_MUL for ARM: Add earlyclobber constraint to the SMULL
+ outputs.
+
+Reported by Rob Browning <rlb@defaultvalue.org>.
+
+* libguile/vm-i-scheme.c (ASM_MUL)[ARM]: Add earlyclobber (&) constraint
+ to the SMULL output registers.
+
+Author: Mark H Weaver <mhw@netris.org>
+
+Upstream-Status: Backport
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ libguile/vm-i-scheme.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c
+index 587aa95..162efab 100644
+--- a/libguile/vm-i-scheme.c
++++ b/libguile/vm-i-scheme.c
+@@ -1,5 +1,4 @@
+-/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013,
+- * 2014 Free Software Foundation, Inc.
++/* Copyright (C) 2001, 2009-2014 Free Software Foundation, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+@@ -363,7 +362,7 @@ VM_DEFINE_FUNCTION (149, ge, "ge?", 2)
+ { \
+ scm_t_signed_bits rlo, rhi; \
+ asm ("smull %0, %1, %2, %3\n" \
+- : "=r" (rlo), "=r" (rhi) \
++ : "=&r" (rlo), "=&r" (rhi) \
+ : "r" (SCM_UNPACK (x) - scm_tc2_int), \
+ "r" (SCM_I_INUM (y))); \
+ if (SCM_LIKELY (SCM_SRS (rlo, 31) == rhi)) \
+--
+2.3.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-64bit.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-64bit.patch
new file mode 100644
index 000000000..d3e312f77
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-64bit.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [opensuse patch]
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Index: guile-2.0.3/libguile/hash.c
+===================================================================
+--- guile-2.0.3.orig/libguile/hash.c 2011-07-06 15:49:59.000000000 -0700
++++ guile-2.0.3/libguile/hash.c 2012-01-13 21:49:43.332844884 -0800
+@@ -270,7 +270,7 @@ scm_hasher(SCM obj, unsigned long n, siz
+ unsigned long
+ scm_ihashq (SCM obj, unsigned long n)
+ {
+- return (SCM_UNPACK (obj) >> 1) % n;
++ return ((unsigned long) SCM_UNPACK (obj) >> 1) % n;
+ }
+
+
+@@ -306,7 +306,7 @@ scm_ihashv (SCM obj, unsigned long n)
+ if (SCM_NUMP(obj))
+ return (unsigned long) scm_hasher(obj, n, 10);
+ else
+- return SCM_UNPACK (obj) % n;
++ return (unsigned long) SCM_UNPACK (obj) % n;
+ }
+
+
+Index: guile-2.0.3/libguile/struct.c
+===================================================================
+--- guile-2.0.3.orig/libguile/struct.c 2011-07-06 15:50:00.000000000 -0700
++++ guile-2.0.3/libguile/struct.c 2012-01-13 21:49:43.332844884 -0800
+@@ -942,7 +942,7 @@ scm_struct_ihashq (SCM obj, unsigned lon
+ {
+ /* The length of the hash table should be a relative prime it's not
+ necessary to shift down the address. */
+- return SCM_UNPACK (obj) % n;
++ return (unsigned long) SCM_UNPACK (obj) % n;
+ }
+
+ SCM_DEFINE (scm_struct_vtable_name, "struct-vtable-name", 1, 0, 0,
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-turn-off-gc-test.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-turn-off-gc-test.patch
new file mode 100644
index 000000000..e20148628
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/opensuse/guile-turn-off-gc-test.patch
@@ -0,0 +1,49 @@
+Upstream-Status: Inappropriate [opensuse patch]
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10096
+why this test is turned off.
+Index: guile-2.0.3/test-suite/tests/gc.test
+===================================================================
+--- guile-2.0.3.orig/test-suite/tests/gc.test 2011-10-15 09:34:40.000000000 -0700
++++ guile-2.0.3/test-suite/tests/gc.test 2012-01-13 21:52:10.282540355 -0800
+@@ -65,23 +65,23 @@
+ foo)))
+
+
+-(with-test-prefix "gc"
+- (pass-if "Unused modules are removed"
+- (let* ((guard (make-guardian))
+- (total 1000))
+-
+- (for-each (lambda (x) (guard (make-module))) (iota total))
++;;(with-test-prefix "gc"
++;; (pass-if "Unused modules are removed"
++;; (let* ((guard (make-guardian))
++;; (total 1000))
++;;
++;; (for-each (lambda (x) (guard (make-module))) (iota total))
+
+ ;; Avoid false references to the modules on the stack.
+- (stack-cleanup 20)
++;; (stack-cleanup 20)
+
+- (gc)
+- (gc) ;; twice: have to kill the weak vectors.
+- (gc) ;; thrice: because the test doesn't succeed with only
++;; (gc)
++;; (gc) ;; twice: have to kill the weak vectors.
++;; (gc) ;; thrice: because the test doesn't succeed with only
+ ;; one gc round. not sure why.
+
+- (= (let lp ((i 0))
+- (if (guard)
+- (lp (1+ i))
+- i))
+- total))))
++;; (= (let lp ((i 0))
++;; (if (guard)
++;; (lp (1+ i))
++;; i))
++;; total))))
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/remove_strcase_l_funcs.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/remove_strcase_l_funcs.patch
new file mode 100644
index 000000000..e7a06fef1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/remove_strcase_l_funcs.patch
@@ -0,0 +1,38 @@
+These unused functions cause build failures with uclibc since they reference __uclibc_locale_struct
+and this is exposed by uclibc API headers only if C locales are built, but for OE we build full locale
+support
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: guile-2.0.11/libguile/i18n.c
+===================================================================
+--- guile-2.0.11.orig/libguile/i18n.c
++++ guile-2.0.11/libguile/i18n.c
+@@ -851,27 +851,6 @@ str_downcase (register char *dst, regist
+ *dst = '\0';
+ }
+
+-#ifdef USE_GNU_LOCALE_API
+-static inline void
+-str_upcase_l (register char *dst, register const char *src,
+- scm_t_locale locale)
+-{
+- for (; *src != '\0'; src++, dst++)
+- *dst = toupper_l (*src, locale);
+- *dst = '\0';
+-}
+-
+-static inline void
+-str_downcase_l (register char *dst, register const char *src,
+- scm_t_locale locale)
+-{
+- for (; *src != '\0'; src++, dst++)
+- *dst = tolower_l (*src, locale);
+- *dst = '\0';
+-}
+-#endif
+-
+-
+ SCM_DEFINE (scm_string_locale_lt, "string-locale<?", 2, 1, 0,
+ (SCM s1, SCM s2, SCM locale),
+ "Compare strings @var{s1} and @var{s2} in a locale-dependent way."
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/files/workaround-ice-ssa-corruption.patch b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/workaround-ice-ssa-corruption.patch
new file mode 100644
index 000000000..6c348384a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/files/workaround-ice-ssa-corruption.patch
@@ -0,0 +1,60 @@
+libguile/vm-i-system.c: workaround ice ssa corruption while compiling with option -g -O
+
+While compiling with option -g -O, there was a ssa corruption:
+..
+Unable to coalesce ssa_names 48 and 3476 which are marked as MUST COALESCE.
+sp_48(ab) and sp_3476(ab)
+guile-2.0.11/libguile/vm-engine.c: In function 'vm_debug_engine':
+guile-2.0.11/libguile/vm.c:673:19: internal compiler error: SSA corruption
+ #define VM_NAME vm_debug_engine
+ ^
+guile-2.0.11/libguile/vm-engine.c:39:1: note: in expansion of macro 'VM_NAME'
+ VM_NAME (SCM vm, SCM program, SCM *argv, int nargs)
+ ^
+Please submit a full bug report,
+with preprocessed source if appropriate.
+See <http://gcc.gnu.org/bugs.html> for instructions.
+...
+
+Tweak libguile/vm-i-system.c to add boundary value check to workaround it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ libguile/vm-i-system.c | 20 ++++++++++++++++----
+ 1 file changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c
+--- a/libguile/vm-i-system.c
++++ b/libguile/vm-i-system.c
+@@ -625,10 +625,22 @@ VM_DEFINE_INSTRUCTION (47, bind_optionals_shuffle, "bind-optionals/shuffle", 6,
+ /* now shuffle up, from walk to ntotal */
+ {
+ scm_t_ptrdiff nshuf = sp - walk + 1, i;
+- sp = (fp - 1) + ntotal + nshuf;
+- CHECK_OVERFLOW ();
+- for (i = 0; i < nshuf; i++)
+- sp[-i] = walk[nshuf-i-1];
++ /* check the value of nshuf to workaround ice ssa corruption */
++ /* while compiling with -O -g */
++ if (nshuf > 0)
++ {
++ sp = (fp - 1) + ntotal + nshuf;
++ CHECK_OVERFLOW ();
++ for (i = 0; i < nshuf; i++)
++ sp[-i] = walk[nshuf-i-1];
++ }
++ else
++ {
++ sp = (fp - 1) + ntotal + nshuf;
++ CHECK_OVERFLOW ();
++ for (i = 0; i < nshuf; i++)
++ sp[-i] = walk[nshuf-i-1];
++ }
+ }
+ /* and fill optionals & keyword args with SCM_UNDEFINED */
+ while (walk <= (fp - 1) + ntotal)
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.11.bb
new file mode 100644
index 000000000..6cefe6649
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guile/guile_2.0.11.bb
@@ -0,0 +1,128 @@
+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://libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch \
+ file://remove_strcase_l_funcs.patch \
+ file://0001-libguile-Check-for-strtol_l-during-configure.patch \
+ file://0002-Recognize-nios2-as-compilation-target.patch \
+ "
+
+# file://debian/0001-Change-guile-to-guile-X.Y-for-info-pages.patch
+# file://opensuse/guile-turn-off-gc-test.patch
+
+SRC_URI[md5sum] = "03f1bce1a4983076d955003472306a13"
+SRC_URI[sha256sum] = "aed0a4a6db4e310cbdfeb3613fa6f86fddc91ef624c1e3f8937a6304c69103e2"
+
+
+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/guilt/files/guilt-bash.patch b/import-layers/yocto-poky/meta/recipes-devtools/guilt/files/guilt-bash.patch
new file mode 100644
index 000000000..70a439e81
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guilt/files/guilt-bash.patch
@@ -0,0 +1,288 @@
+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
new file mode 100644
index 000000000..b63c68c4d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/guilt/guilt-native_git.bb
@@ -0,0 +1,23 @@
+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/help2man/help2man-native_1.47.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/help2man/help2man-native_1.47.3.bb
new file mode 100644
index 000000000..232b0c37a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/help2man/help2man-native_1.47.3.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Program for creating simple man pages"
+SECTION = "devel"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+DEPENDS = "autoconf-native automake-native"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "d1d44a7a7b2bd61755a2045d96ecaea0"
+SRC_URI[sha256sum] = "c232af6475ef65bee02770862a362f4c4c2e6c9967d39e987eb94cadcfc13856"
+
+inherit autotools native
+
+EXTRA_OECONF = "--disable-nls"
+
+# We don't want to reconfigure things as it would require 'perlnative' to be
+# used.
+do_configure() {
+ oe_runconf
+}
+
+do_install_append () {
+ # Make sure we use /usr/bin/env perl
+ sed -i -e "1s:#!.*:#! /usr/bin/env perl:" ${D}${bindir}/help2man
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/files/Module.mk b/import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/files/Module.mk
new file mode 100644
index 000000000..fcaf72f22
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/files/Module.mk
@@ -0,0 +1,72 @@
+# EEPROMER
+#
+# Licensed under the GNU General Public License.
+
+EEPROMER_DIR := eepromer
+
+EEPROMER_CFLAGS := -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \
+ -Wcast-align -Wwrite-strings -Wnested-externs -Winline \
+ -W -Wundef -Wmissing-prototypes -Iinclude
+
+EEPROMER_TARGETS := eepromer eeprom eeprog
+
+#
+# Programs
+#
+
+$(EEPROMER_DIR)/eepromer: $(EEPROMER_DIR)/eepromer.o
+ $(CC) $(LDFLAGS) -o $@ $^
+
+$(EEPROMER_DIR)/eeprom: $(EEPROMER_DIR)/eeprom.o
+ $(CC) $(LDFLAGS) -o $@ $^
+
+$(EEPROMER_DIR)/eeprog: $(EEPROMER_DIR)/eeprog.o $(EEPROMER_DIR)/24cXX.o
+ $(CC) $(LDFLAGS) -o $@ $^
+
+#
+# Objects
+#
+
+$(EEPROMER_DIR)/eepromer.o: $(EEPROMER_DIR)/eepromer.c
+ $(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+$(EEPROMER_DIR)/eeprom.o: $(EEPROMER_DIR)/eeprom.c
+ $(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+$(EEPROMER_DIR)/eeprog.o: $(EEPROMER_DIR)/eeprog.c
+ $(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+$(EEPROMER_DIR)/24cXX.o: $(EEPROMER_DIR)/24cXX.c
+ $(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+#
+# Commands
+#
+
+all-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+
+strip-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+ strip $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+
+clean-eepromer:
+ $(RM) $(addprefix $(EEPROMER_DIR)/,*.o $(EEPROMER_TARGETS))
+
+install-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+ $(INSTALL_DIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
+ for program in $(EEPROMER_TARGETS) ; do \
+ $(INSTALL_PROGRAM) $(EEPROMER_DIR)/$$program $(DESTDIR)$(sbindir) ; done
+
+uninstall-eepromer:
+ for program in $(EEPROMER_TARGETS) ; do \
+ $(RM) $(DESTDIR)$(sbindir)/$$program ; \
+ $(RM) $(DESTDIR)$(man8dir)/$$program.8 ; done
+
+all: all-eepromer
+
+strip: strip-eepromer
+
+clean: clean-eepromer
+
+install: install-eepromer
+
+uninstall: uninstall-eepromer
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.2.bb
new file mode 100644
index 000000000..4d255423e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.2.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Set of i2c tools for linux"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/${BP}.tar.bz2 \
+ file://Module.mk \
+"
+SRC_URI[md5sum] = "7104a1043d11a5e2c7b131614eb1b962"
+SRC_URI[sha256sum] = "db5e69f2e2a6e3aa2ecdfe6a5f490b149c504468770f58921c8c5b8a7860a441"
+
+inherit autotools-brokensep
+
+do_compile_prepend() {
+ cp ${WORKDIR}/Module.mk ${S}/eepromer/
+ sed -i 's#/usr/local#/usr#' ${S}/Makefile
+ echo "include eepromer/Module.mk" >> ${S}/Makefile
+}
+
+do_install_append() {
+ install -d ${D}${includedir}/linux
+ install -m 0644 include/linux/i2c-dev.h ${D}${includedir}/linux/i2c-dev-user.h
+ rm -f ${D}${includedir}/linux/i2c-dev.h
+}
+
+PACKAGES =+ "${PN}-misc"
+FILES_${PN}-misc = "${sbindir}/i2c-stub-from-dump \
+ ${bindir}/ddcmon \
+ ${bindir}/decode-edid \
+ ${bindir}/decode-dimms \
+ ${bindir}/decode-vaio \
+ "
+RDEPENDS_${PN}-misc = "${PN} perl"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb
new file mode 100644
index 000000000..f8f4aef39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb
@@ -0,0 +1,36 @@
+SUMMARY = "icecc environment setup script"
+DESCRIPTION = "This is a version of the icecc-create-env script that has \
+been modified in order to make it work with OE."
+SECTION = "base"
+# source file has just a "GPL" word, but upstream is GPLv2+.
+# most probably just GPL would be a mistake
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://icecc-create-env;beginline=2;endline=5;md5=ae1df3d6a058bfda40b66094c5f6065f"
+
+PR = "r2"
+
+DEPENDS = ""
+INHIBIT_DEFAULT_DEPS = "1"
+
+inherit native
+
+# This is needed, because otherwise there is dependency loop from quilt-native
+# Dependency loop #1 found:
+# Task 10907 (meta/recipes-devtools/quilt/quilt-native_0.60.bb, do_install) (dependent Tasks ['quilt-native, do_compile'])
+# Task 10908 (meta/recipes-devtools/quilt/quilt-native_0.60.bb, do_populate_sysroot) (dependent Tasks ['quilt-native, do_install'])
+# Task 10997 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_patch) (dependent Tasks ['icecc-create-env-native, do_unpack', 'quilt-native, do_populate_sysroot'])
+# Task 11001 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_configure) (dependent Tasks ['icecc-create-env-native, do_patch'])
+# Task 11002 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_compile) (dependent Tasks ['icecc-create-env-native, do_configure'])
+# Task 10998 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_install) (dependent Tasks ['icecc-create-env-native, do_compile'])
+# Task 10999 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_populate_sysroot) (dependent Tasks ['icecc-create-env-native, do_install'])
+# Task 10910 (meta/recipes-devtools/quilt/quilt-native_0.60.bb, do_configure) (dependent Tasks ['quilt-native, do_patch', 'icecc-create-env-native, do_populate_sysroot'])
+# Task 10911 (meta/recipes-devtools/quilt/quilt-native_0.60.bb, do_compile) (dependent Tasks ['quilt-native, do_configure'])
+PATCHTOOL = "patch"
+SRC_URI = "file://icecc-create-env"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}/${bindir}
+ install -m 0755 ${WORKDIR}/icecc-create-env ${D}/${bindir}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env b/import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env
new file mode 100755
index 000000000..7e4dbc414
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env
@@ -0,0 +1,192 @@
+#! /usr/bin/env bash
+# icecc -- A simple distributed compiler system
+#
+# Copyright (C) 2004 by the Icecream Authors
+# GPL
+
+target_files=
+
+is_contained ()
+{
+ case " $target_files " in
+ *" $1 "* ) return 0 ;;
+ *"=$1 "* ) return 0;;
+ * ) return 1 ;;
+ esac
+}
+
+add_file ()
+{
+ local name="$1"
+ local path="$1";
+ if test -n "$2"; then
+ name="$2"
+ fi
+ test -z "$name" && return
+ # ls -H isn't really the same as readlink, but
+ # readlink is not portable enough.
+ path=`ls -H $path`
+ toadd="$name=$path"
+ is_contained "$toadd" && return
+ if test -z "$silent"; then
+ echo "adding file $toadd"
+ fi
+ target_files="$target_files $toadd"
+ if test -x "$path"; then
+ # Only call ldd when it makes sense
+ if file -L "$path" | grep 'ELF' > /dev/null 2>&1; then
+ if ! file -L "$path" | grep 'static' > /dev/null 2>&1; then
+ # ldd now outputs ld as /lib/ld-linux.so.xx on current nptl based glibc
+ # this regexp parse the outputs like:
+ # ldd /usr/bin/gcc
+ # linux-gate.so.1 => (0xffffe000)
+ # libc.so.6 => /lib/tls/libc.so.6 (0xb7e81000)
+ # /lib/ld-linux.so.2 (0xb7fe8000)
+ # covering both situations ( with => and without )
+ for lib in `ldd "$path" | sed -n 's,^[^/]*\(/[^ ]*\).*,\1,p'`; do
+ test -f "$lib" || continue
+ # Check wether the same library also exists in the parent directory,
+ # and prefer that on the assumption that it is a more generic one.
+ local baselib=`echo "$lib" | sed 's,\(/[^/]*\)/.*\(/[^/]*\)$,\1\2,'`
+ test -f "$baselib" && lib=$baselib
+ add_file "$lib"
+ done
+ fi
+ fi
+ fi
+}
+
+# backward compat
+if test "$1" = "--respect-path"; then
+ shift
+fi
+
+#add a --silent switch to avoid "broken pipe" errors when calling this scipt from within OE
+if test "$1" = "--silent"; then
+ silent=1
+ shift
+fi
+
+
+added_gcc=$1
+shift
+added_gxx=$1
+shift
+added_as=$1
+shift
+archive_name=$1
+
+if test -z "$added_gcc" || test -z "$added_gxx" ; then
+ echo "usage: $0 <gcc_path> <g++_path>"
+ exit 1
+fi
+
+if ! test -x "$added_gcc" ; then
+ echo "'$added_gcc' is no executable."
+ exit 1
+fi
+
+if ! test -x "$added_gxx" ; then
+ echo "'$added_gcc' is no executable."
+ exit 1
+fi
+
+
+
+add_file $added_gcc /usr/bin/gcc
+add_file $added_gxx /usr/bin/g++
+
+if test -z "$added_as" ; then
+ add_file /usr/bin/as /usr/bin/as
+else
+ if ! test -x "$added_as" ; then
+ echo "'$added_as' is no executable."
+ exit 1
+ fi
+
+ add_file $added_as /usr/bin/as
+fi
+
+add_file `$added_gcc -print-prog-name=cc1` /usr/bin/cc1
+add_file `$added_gxx -print-prog-name=cc1plus` /usr/bin/cc1plus
+specfile=`$added_gcc -print-file-name=specs`
+if test -n "$specfile" && test -e "$specfile"; then
+ add_file "$specfile"
+fi
+
+ltofile=`$added_gcc -print-prog-name=lto1`
+pluginfile="${ltofile%lto1}liblto_plugin.so"
+if test -r "$pluginfile"
+then
+ add_file $pluginfile ${pluginfile#*usr}
+ add_file $pluginfile /usr${pluginfile#*usr}
+fi
+
+tempdir=`mktemp -d /tmp/iceccenvXXXXXX`
+new_target_files=
+for i in $target_files; do
+ case $i in
+ *=/*)
+ target=`echo $i | cut -d= -f1`
+ path=`echo $i | cut -d= -f2`
+ ;;
+ *)
+ path=$i
+ target=$i
+ ;;
+ esac
+ mkdir -p $tempdir/`dirname $target`
+ cp -p $path $tempdir/$target
+ if test -f $tempdir/$target -a -x $tempdir/$target; then
+ strip -s $tempdir/$target 2>/dev/null
+ fi
+ target=`echo $target | cut -b2-`
+ new_target_files="$new_target_files $target"
+done
+
+#sort the files
+target_files=`for i in $new_target_files; do echo $i; done | sort`
+
+#test if an archive name was supplied
+#if not use the md5 of all files as the archive name
+if test -z "$archive_name"; then
+ md5sum=NONE
+ for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5; do
+ if test -x $file; then
+ md5sum=$file
+ break
+ fi
+ done
+
+ #calculate md5 and use it as the archive name
+ archive_name=`for i in $target_files; do test -f $tempdir/$i && $md5sum $tempdir/$i; done | sed -e 's/ .*$//' | $md5sum | sed -e 's/ .*$//'`.tar.gz || {
+ if test -z "$silent"; then
+ echo "Couldn't compute MD5 sum."
+ fi
+ exit 2
+ }
+ mydir=`pwd`
+else
+ mydir="`dirname "$archive_name"`"
+
+ #check if we have a full path or only a filename
+ if test "$mydir" = "." ; then
+ mydir=`pwd`
+ else
+ mydir=""
+ fi
+fi
+
+if test -z "$silent"; then
+echo "creating $archive_name"
+fi
+
+cd $tempdir
+tar -czhf "$mydir/$archive_name" $target_files || {
+ if test -z "$silent"; then
+ echo "Couldn't create archive"
+ fi
+ exit 3
+}
+cd ..
+rm -rf $tempdir
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb b/import-layers/yocto-poky/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb
new file mode 100644
index 000000000..6b356b0d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Enables backwards compatibility with current desktop icon themes"
+DESCRIPTION = "A Perl script used for maintaining backwards \
+compatibility with current desktop icon themes, while migrating to the \
+names specified in the Icon Naming Specification. The Icon Naming \
+Utilities map the icon names used by the GNOME and KDE desktops to the \
+icon names proposed in the Icon Naming Specification, and generate the \
+icon files appropriate to the desktop environment you use. The Icon \
+Naming Specification provides a standard list of common icon contexts \
+and names that can be used to make icon themes work in a desktop \
+environment or application that implements the naming specification. "
+LICENSE = "GPLv2"
+DEPENDS = "libxml-simple-perl-native"
+PR = "r5"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://tango.freedesktop.org/releases/icon-naming-utils-${PV}.tar.gz"
+SRC_URI[md5sum] = "2c5c7a418e5eb3268f65e21993277fba"
+SRC_URI[sha256sum] = "044ab2199ed8c6a55ce36fd4fcd8b8021a5e21f5bab028c0a7cdcf52a5902e1c"
+
+inherit autotools allarch perlnative
+
+do_configure_append() {
+ # Make sure we use our nativeperl wrapper.
+ sed -i -e "1s:#!.*:#!/usr/bin/env nativeperl:" ${S}/icon-name-mapping.pl.in
+}
+
+FILES_${PN} += "${datadir}/dtds"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool.inc b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool.inc
new file mode 100644
index 000000000..eb7ae004a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool.inc
@@ -0,0 +1,30 @@
+SUMMARY = "Utility scripts for internationalizing XML"
+SECTION = "devel"
+LICENSE = "GPLv2"
+
+URLV="${@'.'.join(d.getVar('PV',1).split('.')[0:2])}"
+SRC_URI = "http://launchpad.net/${BPN}/trunk/${PV}/+download/${BP}.tar.gz"
+
+UPSTREAM_CHECK_URI = "https://launchpad.net/intltool/trunk/"
+
+S = "${WORKDIR}/intltool-${PV}"
+
+DEPENDS = "libxml-parser-perl-native"
+RDEPENDS_${PN} = "gettext-dev libxml-parser-perl"
+DEPENDS_class-native = "libxml-parser-perl-native"
+# gettext is assumed to exist on the host
+RDEPENDS_${PN}_class-native = "libxml-parser-perl-native"
+RRECOMMENDS_${PN} = "perl-modules"
+RRECOMMENDS_${PN}_class-native = ""
+
+FILES_${PN}-dev = ""
+FILES_${PN} += "${datadir}/aclocal"
+
+INSANE_SKIP_${PN} += "dev-deps"
+
+inherit autotools pkgconfig perlnative
+
+export PERL = "${bindir}/env perl"
+PERL_class-native = "/usr/bin/env nativeperl"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch
new file mode 100644
index 000000000..06c938b7e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Index: intltool-0.40.0/intltool-extract.in
+===================================================================
+--- intltool-0.50.0.orig/intltool-extract.in 2011-10-08 22:24:57.000000000 +0300
++++ intltool-0.50.0/intltool-extract.in 2011-12-07 16:04:07.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!@INTLTOOL_PERL@ -w
++#!@INTLTOOL_PERL@
+ # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+ #
+Index: intltool-0.50.0/intltool-merge.in
+===================================================================
+--- intltool-0.50.0.orig/intltool-merge.in 2011-10-08 17:52:01.000000000 +0300
++++ intltool-0.50.0/intltool-merge.in 2011-12-07 16:05:55.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!@INTLTOOL_PERL@ -w
++#!@INTLTOOL_PERL@
+ # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+ #
+Index: intltool-0.50.0/intltool-prepare.in
+===================================================================
+--- intltool-0.50.0.orig/intltool-prepare.in 2011-10-08 09:16:58.000000000 +0300
++++ intltool-0.50.0/intltool-prepare.in 2011-12-07 16:06:13.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!@INTLTOOL_PERL@ -w
++#!@INTLTOOL_PERL@
+ # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+ # Intltool .desktop, .directory Prepare Tool
+Index: intltool-0.50.0/intltool-update.in
+===================================================================
+--- intltool-0.50.0.orig/intltool-update.in 2011-10-08 22:24:57.000000000 +0300
++++ intltool-0.50.0/intltool-update.in 2011-12-07 16:06:39.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!@INTLTOOL_PERL@ -w
++#!@INTLTOOL_PERL@
+ # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+ #
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/noperlcheck.patch b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/noperlcheck.patch
new file mode 100644
index 000000000..853ee1a43
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/noperlcheck.patch
@@ -0,0 +1,40 @@
+In the target case, we can't check if perl exists or try running it. If we
+don't patch the code, the native perl location would be used, not the target
+which is also incorrect. We therefore disable this code and rely on the
+correct value of PERL being passed in.
+
+RP 31/8/2011
+
+Upstream-Status: Inappropriate [OE specific]
+
+diff --git a/configure.ac b/configure.ac
+index 5338a76..e709a2b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -11,24 +11,10 @@ AC_SUBST(pkgdatadir) dnl automake does not need this, but libtoolize does
+ aclocaldir='${datadir}'/aclocal
+ AC_SUBST(aclocaldir)
+
+-AC_PATH_PROG(PERL, perl)
+ if test -z "$PERL"; then
+- AC_MSG_ERROR([perl not found])
+-fi
+-AC_MSG_CHECKING([for perl >= 5.8.1])
+-$PERL -e "use 5.8.1;" > /dev/null 2>&1
+-if test $? -ne 0; then
+- AC_MSG_ERROR([perl 5.8.1 is required for intltool])
+-else
+- PERL_VERSION="`$PERL -e \"printf '%vd', $^V\"`"
+- AC_MSG_RESULT([$PERL_VERSION])
+-fi
+-AC_MSG_CHECKING([for XML::Parser])
+-if `$PERL -e "require XML::Parser" 2>/dev/null`; then
+- AC_MSG_RESULT([ok])
+-else
+- AC_MSG_ERROR([XML::Parser perl module is required for intltool])
++ AC_MSG_ERROR([PERL variable not set])
+ fi
++AC_SUBST(PERL)
+ AC_PATH_PROG(BZR, bzr)
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch
new file mode 100644
index 000000000..eb52172e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch
@@ -0,0 +1,55 @@
+Perl 5.22 has deprecated some regex features, which causes warnings when
+intltool-update runs:
+
+Unescaped left brace in regex is deprecated, passed through in regex; marked by
+<-- HERE in m/^(.*)\${ <-- HERE ?([A-Z_]+)}?(.*)$/ at
+/data/poky-master/tmp/sysroots/x86_64-linux/usr/bin/intltool-update line 1065.
+
+Take a patch from Debian to solve this.
+
+Upstream-Status: Submitted (https://bugs.launchpad.net/intltool/+bug/1465010)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+--- intltool-0.51.0-ORIG/intltool-update.in 2015-05-27 00:20:43.038379963 +0200
++++ intltool-0.51.0/intltool-update.in 2015-05-27 00:23:53.309078052 +0200
+@@ -1062,7 +1062,7 @@
+ }
+ }
+
+- if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/)
++ if ($str =~ /^(.*)\$\{?([A-Z_]+)\}?(.*)$/)
+ {
+ my $rest = $3;
+ my $untouched = $1;
+@@ -1190,10 +1190,10 @@
+ $name =~ s/\(+$//g;
+ $version =~ s/\(+$//g;
+
+- $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
+- $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
+- $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
+- $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
++ $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME\}?/);
++ $varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE\}?/);
++ $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION\}?/);
++ $varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION\}?/);
+ }
+
+ if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)[,]?([^,\)]+)?/m)
+@@ -1219,11 +1219,11 @@
+ $version =~ s/\(+$//g;
+ $bugurl =~ s/\(+$//g if (defined $bugurl);
+
+- $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
+- $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
+- $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
+- $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
+- $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\${?\w+}?/);
++ $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME\}?/);
++ $varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE\}?/);
++ $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION\}?/);
++ $varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION\}?/);
++ $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\$\{?\w+\}?/);
+ }
+
+ # \s makes this not work, why? \ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/remove-xml-check.patch b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/remove-xml-check.patch
new file mode 100644
index 000000000..fc69e37b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/remove-xml-check.patch
@@ -0,0 +1,33 @@
+Signed-off-by: Florin Sarbu <florin.sarbu@windriver.com>
+
+Upstream-Status: Inappropriate [OE specific]
+
+Index: intltool-0.40.6/intltool.m4
+===================================================================
+--- intltool-0.40.6.orig/intltool.m4 2009-02-14 14:12:28.000000000 -0800
++++ intltool-0.40.6/intltool.m4 2011-11-23 15:39:34.689561872 -0800
+@@ -122,14 +122,16 @@
+ IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`"
+ AC_MSG_RESULT([$IT_PERL_VERSION])
+ fi
+-if test "x$2" != "xno-xml"; then
+- AC_MSG_CHECKING([for XML::Parser])
+- if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
+- AC_MSG_RESULT([ok])
+- else
+- AC_MSG_ERROR([XML::Parser perl module is required for intltool])
+- fi
+-fi
++
++# Disable this check since we know XML::Parser is installed
++#if test "x$2" != "xno-xml"; then
++# AC_MSG_CHECKING([for XML::Parser])
++# if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
++# AC_MSG_RESULT([ok])
++# else
++# AC_MSG_ERROR([XML::Parser perl module is required for intltool])
++# fi
++#fi
+
+ # Substitute ALL_LINGUAS so we can use it in po/Makefile
+ AC_SUBST(ALL_LINGUAS)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/use-nativeperl.patch b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/use-nativeperl.patch
new file mode 100644
index 000000000..5f5fed385
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool/use-nativeperl.patch
@@ -0,0 +1,20 @@
+OE has perl binary as 'nativeperl' in native sysroot so we look for it
+in order to avoid intltool searching and finding perl from /usr/bin
+on build system which may not have all the modules that it needs.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE specific]
+Index: intltool-0.40.6/intltool.m4
+===================================================================
+--- intltool-0.40.6.orig/intltool.m4 2009-02-14 14:12:28.000000000 -0800
++++ intltool-0.40.6/intltool.m4 2011-08-09 08:07:16.427347846 -0700
+@@ -110,7 +110,7 @@
+ AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
+ fi
+
+-AC_PATH_PROG(INTLTOOL_PERL, perl)
++AC_PATH_PROG(INTLTOOL_PERL, nativeperl)
+ if test -z "$INTLTOOL_PERL"; then
+ AC_MSG_ERROR([perl not found])
+ fi
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
new file mode 100644
index 000000000..d520d43c1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb
@@ -0,0 +1,19 @@
+require intltool.inc
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI += "file://intltool-nowarn.patch \
+ file://perl-522-deprecations.patch \
+ ${NATIVEPATCHES} \
+ "
+
+#
+# All of the intltool scripts have the correct paths to perl already
+# embedded into them and can find perl fine, so we add the remove xml-check
+# in the intltool.m4 via the remove-xml-check.patch
+NATIVEPATCHES = "file://noperlcheck.patch \
+ file://remove-xml-check.patch"
+NATIVEPATCHES_class-native = "file://use-nativeperl.patch"
+
+SRC_URI[md5sum] = "12e517cac2b57a0121cda351570f1e63"
+SRC_URI[sha256sum] = "67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch b/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch
new file mode 100644
index 000000000..d29d9118d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch
@@ -0,0 +1,37 @@
+From 9be71700eb580c815688584a64621a38867c3fdd Mon Sep 17 00:00:00 2001
+From: James Myatt <james.myatt@tessella.com>
+Date: Thu, 5 Feb 2015 15:57:14 +0000
+Subject: [PATCH] json_tokener requires INF and NAN
+
+---
+Upstream-Status: Backport
+
+ json_tokener.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+Index: json-c-0.12/json_tokener.c
+===================================================================
+--- json-c-0.12.orig/json_tokener.c
++++ json-c-0.12/json_tokener.c
+@@ -16,6 +16,7 @@
+ #include "config.h"
+
+ #include <math.h>
++#include "math_compat.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
+@@ -352,12 +353,10 @@ struct json_object* json_tokener_parse_e
+
+ case json_tokener_state_inf: /* aka starts with 'i' */
+ {
+- int size;
+- int size_inf;
++ size_t size_inf;
+ int is_negative = 0;
+
+ printbuf_memappend_fast(tok->pb, &c, 1);
+- size = json_min(tok->st_pos+1, json_null_str_len);
+ size_inf = json_min(tok->st_pos+1, json_inf_str_len);
+ char *infbuf = tok->pb->buf;
+ if (*infbuf == '-')
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
new file mode 100644
index 000000000..1a5c3948e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/json-c/json-c_0.12.bb
@@ -0,0 +1,29 @@
+SUMMARY = "C bindings for apps which will manipulate JSON data"
+DESCRIPTION = "JSON-C implements a reference counting object model that allows you to easily construct JSON objects in C."
+HOMEPAGE = "https://github.com/json-c/json-c/wiki"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=de54b60fbbc35123ba193fea8ee216f2"
+
+SRC_URI = "https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz \
+ file://0001-json_tokener-requires-INF-and-NAN.patch \
+ "
+
+SRC_URI[md5sum] = "3ca4bbb881dfc4017e8021b5e0a8c491"
+SRC_URI[sha256sum] = "000c01b2b3f82dcb4261751eb71f1b084404fb7d6a282f06074d3c17078b9f3f"
+
+UPSTREAM_CHECK_REGEX = "json-c-(?P<pver>\d+(\.\d+)+).tar"
+# json-c releases page is fetching the list of releases in some weird XML format
+# from https://s3.amazonaws.com/json-c_releases and processes it with javascript :-/
+#UPSTREAM_CHECK_URI = "https://s3.amazonaws.com/json-c_releases/releases/index.html"
+RECIPE_UPSTREAM_VERSION = "0.12"
+RECIPE_UPSTREAM_DATE = "Apr 11, 2014"
+CHECK_DATE = "Dec 04, 2015"
+
+RPROVIDES_${PN} = "libjson"
+
+inherit autotools
+
+do_configure_prepend() {
+ # Clean up autoconf cruft that should not be in the tarball
+ rm -f ${S}/config.status
+}
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
new file mode 100644
index 000000000..48a2f935b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb
@@ -0,0 +1,38 @@
+# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Linux kernel style configuration framework for other projects"
+DESCRIPTION = "The kconfig-frontends project aims at centralising \
+the effort of keeping an up-to-date, out-of-tree, packaging of the \
+kconfig infrastructure, ready for use by third-party projects. \
+The kconfig-frontends package provides the kconfig parser, as well as all \
+the frontends"
+HOMEPAGE = "http://ymorin.is-a-geek.org/projects/kconfig-frontends"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9b8cf60ff39767ff04b671fca8302408"
+SECTION = "devel"
+DEPENDS += "ncurses flex bison gperf-native pkgconfig-native"
+RDEPENDS_${PN} += "python bash"
+SRC_URI = "http://ymorin.is-a-geek.org/download/${BPN}/${BP}.tar.xz"
+
+SRC_URI[md5sum] = "b939280dcc83f8feabd87a1d5f9b00c2"
+SRC_URI[sha256sum] = "ea2615a62c74bea6ce3b38402f00c7513858f307f6ba7aa9fdbf0bbc12bcf407"
+
+inherit autotools
+do_configure_prepend () {
+ mkdir -p scripts/.autostuff/m4
+}
+
+do_install_append() {
+ ln -s kconfig-conf ${D}${bindir}/conf
+ ln -s kconfig-mconf ${D}${bindir}/mconf
+}
+
+EXTRA_OECONF += "--disable-gconf --disable-qconf"
+
+# Some packages have the version preceeding the .so instead properly
+# versioned .so.<version>, so we need to reorder and repackage.
+SOLIBS = "-${@d.getVar('PV',1)[:-2]}.so"
+FILES_SOLIBSDEV = "${libdir}/libkconfig-parser.so"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc
new file mode 100644
index 000000000..f307a1075
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc
@@ -0,0 +1,48 @@
+SUMMARY = "Generic library support script"
+DESCRIPTION = "This is GNU libtool, a generic library support script. \
+Libtool hides the complexity of generating special library types \
+(such as shared libraries) behind a consistent interface."
+HOMEPAGE = "http://www.gnu.org/software/libtool/libtool.html"
+SECTION = "devel"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://libltdl/COPYING.LIB;md5=4fbd65380cdd255951079008b364516c "
+
+SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \
+ file://trailingslash.patch \
+ file://rename-with-sysroot.patch \
+ file://use-sysroot-in-libpath.patch \
+ file://fix-final-rpath.patch \
+ file://fix-rpath.patch \
+ file://norm-rpath.patch \
+ file://dont-depend-on-help2man.patch \
+ file://fix-resolve-lt-sysroot.patch \
+ file://nohardcodepaths.patch \
+ file://unwind-opt-parsing.patch \
+ file://0001-libtool-Fix-support-for-NIOS2-processor.patch \
+ "
+
+SRC_URI[md5sum] = "addf44b646ddb4e3919805aa88fa7c5e"
+SRC_URI[sha256sum] = "e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3"
+
+do_compile_prepend () {
+ # Sometimes this file doesn't get rebuilt, force the issue
+ rm -f ${S}/build-aux/ltmain.sh
+ make build-aux/ltmain.sh
+ ./config.status
+}
+
+inherit autotools texinfo
+EXTRA_AUTORECONF = "--exclude=libtoolize"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_GREP=grep"
+
+DEPENDS = "libtool-native"
+
+PACKAGES =+ "libltdl"
+FILES_${PN} += "${datadir}/aclocal"
+
+FILES_${PN}-dev_remove = "${datadir}/aclocal"
+FILES_libltdl = "${libdir}/libltdl${SOLIBS}"
+
+export CONFIG_SHELL="/bin/bash"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
new file mode 100644
index 000000000..0204d347b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
@@ -0,0 +1,45 @@
+require libtool-${PV}.inc
+
+PACKAGES = ""
+SRC_URI += "file://prefix.patch"
+SRC_URI += "file://fixinstall.patch"
+
+datadir = "${STAGING_DIR_TARGET}${target_datadir}"
+
+do_configure_prepend () {
+ # Remove any existing libtool m4 since old stale versions would break
+ # any upgrade
+ rm -f ${STAGING_DATADIR}/aclocal/libtool.m4
+ rm -f ${STAGING_DATADIR}/aclocal/lt*.m4
+}
+
+do_install () {
+ install -d ${D}${bindir_crossscripts}/
+ install -m 0755 ${HOST_SYS}-libtool ${D}${bindir_crossscripts}/${HOST_SYS}-libtool
+ sed -e 's@^\(predep_objects="\).*@\1"@' \
+ -e 's@^\(postdep_objects="\).*@\1"@' \
+ -i ${D}${bindir_crossscripts}/${HOST_SYS}-libtool
+ sed -i '/^archive_cmds=/s/\-nostdlib//g' ${D}${bindir_crossscripts}/${HOST_SYS}-libtool
+ sed -i '/^archive_expsym_cmds=/s/\-nostdlib//g' ${D}${bindir_crossscripts}/${HOST_SYS}-libtool
+ GREP='/bin/grep' SED='sed' ${S}/build-aux/inline-source libtoolize > ${D}${bindir_crossscripts}/libtoolize
+ chmod 0755 ${D}${bindir_crossscripts}/libtoolize
+ install -d ${D}${target_datadir}/libtool/build-aux/
+ install -d ${D}${target_datadir}/aclocal/
+ install -c ${S}/build-aux/compile ${D}${target_datadir}/libtool/build-aux/
+ install -c ${S}/build-aux/config.guess ${D}${target_datadir}/libtool/build-aux/
+ install -c ${S}/build-aux/config.sub ${D}${target_datadir}/libtool/build-aux/
+ install -c ${S}/build-aux/depcomp ${D}${target_datadir}/libtool/build-aux/
+ install -c ${S}/build-aux/install-sh ${D}${target_datadir}/libtool/build-aux/
+ install -c ${S}/build-aux/missing ${D}${target_datadir}/libtool/build-aux/
+ install -c -m 0644 ${S}/build-aux/ltmain.sh ${D}${target_datadir}/libtool/build-aux/
+ install -c -m 0644 ${S}/m4/*.m4 ${D}${target_datadir}/aclocal/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "libtoolcross_sysroot_preprocess"
+
+libtoolcross_sysroot_preprocess () {
+ sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
+ sysroot_stage_dir ${D}${target_datadir} ${SYSROOT_DESTDIR}${target_datadir}
+}
+
+SSTATE_SCAN_FILES += "libtoolize *-libtool"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb
new file mode 100644
index 000000000..4c5218ade
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb
@@ -0,0 +1,22 @@
+require libtool-${PV}.inc
+
+DEPENDS = ""
+
+SRC_URI += "file://prefix.patch"
+
+inherit native
+
+EXTRA_OECONF = " --with-libtool-sysroot=${STAGING_DIR_NATIVE}"
+
+do_configure_prepend () {
+ # Remove any existing libtool m4 since old stale versions would break
+ # any upgrade
+ rm -f ${STAGING_DATADIR}/aclocal/libtool.m4
+ rm -f ${STAGING_DATADIR}/aclocal/lt*.m4
+}
+
+do_install () {
+ autotools_do_install
+ install -d ${D}${bindir}/
+ install -m 0755 ${HOST_SYS}-libtool ${D}${bindir}/${HOST_SYS}-libtool
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/0001-libtool-Fix-support-for-NIOS2-processor.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/0001-libtool-Fix-support-for-NIOS2-processor.patch
new file mode 100644
index 000000000..bbd36d8dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/0001-libtool-Fix-support-for-NIOS2-processor.patch
@@ -0,0 +1,68 @@
+From df2cd898e48208f26320d40c3ed6b19c75c27142 Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Thu, 17 Sep 2015 00:43:15 +0200
+Subject: [PATCH] libtool: Fix support for NIOS2 processor
+
+The name of the system contains the string "nios2". This string
+is caught by the some of the greedy checks for OS/2 in libtool,
+in particular the *os2* branches of switch statements match for
+the nios2 string, which results in incorrect behavior of libtool.
+
+This patch adds an explicit check for *nios2* before the *os2*
+checks to prevent the OS/2 check incorrectly trapping the nios2
+as well.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Submitted
+---
+ build-aux/ltmain.in | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+index d5cf07a..4164284 100644
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -504,6 +504,12 @@ libtool_validate_options ()
+ test : = "$debug_cmd" || func_append preserve_args " --debug"
+
+ case $host in
++ # For NIOS2, we want to make sure that it's not caught by the
++ # more general OS/2 check below. Otherwise, NIOS2 is the same
++ # as the default option.
++ *nios2*)
++ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
++ ;;
+ # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
+ # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+ *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+@@ -6220,6 +6226,15 @@ func_mode_link ()
+ if test -n "$library_names" &&
+ { test no = "$use_static_libs" || test -z "$old_library"; }; then
+ case $host in
++ *nios2*)
++ # For NIOS2, we want to make sure that it's not caught by the
++ # more general OS/2 check below. Otherwise, NIOS2 is the same
++ # as the default option.
++ if test no = "$installed"; then
++ func_append notinst_deplibs " $lib"
++ need_relink=yes
++ fi
++ ;;
+ *cygwin* | *mingw* | *cegcc* | *os2*)
+ # No point in relinking DLLs because paths are not encoded
+ func_append notinst_deplibs " $lib"
+@@ -6290,6 +6305,11 @@ func_mode_link ()
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
++ *nios2*)
++ # For NIOS2, we want to make sure that it's not caught by the
++ # more general OS/2 check below. Otherwise, NIOS2 is the same
++ # as the default option.
++ ;;
+ *cygwin* | mingw* | *cegcc* | *os2*)
+ func_arith $current - $age
+ major=$func_arith_result
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch
new file mode 100644
index 000000000..fd4084c85
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/Makefile.am b/Makefile.am
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -404,21 +404,6 @@ $(notes_txt): $(notes_texi)
+ $(AM_V_GEN)$(MAKEINFO) -P '$(srcdir)/doc' --no-headers \
+ $(MAKEINFOFLAGS) -o '$@' '$(notes_texi)'
+
+-dist_man1_MANS = $(libtool_1) $(libtoolize_1)
+-MAINTAINERCLEANFILES += $(dist_man1_MANS)
+-update_mans = \
+- PATH=".$(PATH_SEPARATOR)$$PATH"; export PATH; \
+- $(HELP2MAN) --output='$@'
+-
+-# It's wrong to make distributed files (e.g. $(libtool_1)) rely on
+-# files created in the build tree, so instead we regenerate the
+-# manual pages if the sources for the build-tree files we want to
+-# run have changed.
+-$(libtool_1): $(ltmain_sh)
+- $(AM_V_GEN)$(update_mans) --help-option=--help-all libtool
+-$(libtoolize_1): $(libtoolize_in)
+- $(AM_V_GEN)$(update_mans) libtoolize
+-
+
+ ## ------------- ##
+ ## Installation. ##
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch
new file mode 100644
index 000000000..5c9f8cc9c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch
@@ -0,0 +1,50 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Enalbing sysroot support 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@intel.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -7569,9 +7569,11 @@ EOF
+ test relink = "$opt_mode" || 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
+@@ -8301,6 +8303,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
+@@ -8352,6 +8358,10 @@ EOF
+ hardcode_libdirs=
+ for libdir in $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
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch
new file mode 100644
index 000000000..1bd95980c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Pending
+
+This patch updates libtool.m4 (and its output) to resolve a problem
+with variable 'lt_sysroot' not being properly updated if the option
+'--with[-libtool]-sysroot' is not provided when running the 'configure'
+script for a package.
+
+I have also reported the problem to libtool here
+
+http://lists.gnu.org/archive/html/bug-libtool/2013-09/msg00005.html
+
+Signed-off-by: Hans Beckerus <hans.beckerus at gmail.com>
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+---
+diff --git a/m4/libtool.m4 b/m4/libtool.m4
+--- a/m4/libtool.m4
++++ b/m4/libtool.m4
+@@ -1225,16 +1225,21 @@ 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)
++ no)
+ if test yes = "$GCC"; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++ # Treat "/" the same a an unset sysroot. It seems to be more
++ # compatible across host platforms that way!?
++ if test "$lt_sysroot" = /; then
++ lt_sysroot=
++ fi
+ fi
+ ;; #(
++ yes|''|/)
++ ;; #(
+ /*)
+ 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.])
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-rpath.patch
new file mode 100644
index 000000000..a2ec9473e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fix-rpath.patch
@@ -0,0 +1,65 @@
+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.
+
+RP 23/9/2011
+
+Upstream-Status: Pending
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+Index: libtool-2.4.2/build-aux/ltmain.in
+===================================================================
+--- libtool-2.4.2.orig/build-aux/ltmain.in
++++ libtool-2.4.2/build-aux/ltmain.in
+@@ -7286,8 +7286,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
+@@ -8019,8 +8025,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
+@@ -8070,8 +8082,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/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fixinstall.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fixinstall.patch
new file mode 100644
index 000000000..8f343bf43
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/fixinstall.patch
@@ -0,0 +1,102 @@
+There is no point in having "executable" binaries in the .libs
+directory linked with different rpaths to the target which
+could concivably be run on the build system when cross compiling.
+
+This patch removes the extra rpaths ($compile_rpath) so that the
+output from the "link" stage can be used on the target. We can then
+avoid having to "relink" during the install stage.
+
+This saves some build time (do_install is over 2 minutes faster for
+pulseaudio).
+
+This patch also removes an annoying "seems to be moved" warning
+which is totally bogus in the sysroot case.
+
+Upstream-Status: Inappropriate [upstream are unlikely to take a patch like this]
+
+RP 2011/11/16
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -2355,7 +2355,7 @@ func_mode_install ()
+ dir=$func_dirname_result
+ func_append dir "$objdir"
+
+- if test -n "$relink_command"; then
++ if test "$fast_install" = no && test -n "$relink_command"; then
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$libdir"
+ destlibdir=$func_stripname_result
+@@ -2394,7 +2394,7 @@ func_mode_install ()
+ shift
+
+ srcname=$realname
+- test -n "$relink_command" && srcname=${realname}T
++ test "$fast_install" = no && test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+@@ -6162,15 +6162,15 @@ func_mode_link ()
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+- case " $sys_lib_dlsearch_path " in
+- *" $absdir "*) ;;
+- *)
+- case "$compile_rpath " in
+- *" $absdir "*) ;;
+- *) func_append compile_rpath " $absdir" ;;
+- esac
+- ;;
+- esac
++ #case " $sys_lib_dlsearch_path " in
++ #*" $absdir "*) ;;
++ #*)
++ # case "$compile_rpath " in
++ # *" $absdir "*) ;;
++ # *) func_append compile_rpath " $absdir" ;;
++ # esac
++ # ;;
++ #esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+@@ -6236,15 +6236,15 @@ func_mode_link ()
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+- case " $sys_lib_dlsearch_path " in
+- *" $absdir "*) ;;
+- *)
+- case "$compile_rpath " in
+- *" $absdir "*) ;;
+- *) func_append compile_rpath " $absdir" ;;
+- esac
+- ;;
+- esac
++ #case " $sys_lib_dlsearch_path " in
++ #*" $absdir "*) ;;
++ #*)
++ # case "$compile_rpath " in
++ # *" $absdir "*) ;;
++ # *) func_append compile_rpath " $absdir" ;;
++ # esac
++ # ;;
++ #esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+@@ -6590,8 +6590,8 @@ func_mode_link ()
+ 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" && \
+- func_warning "'$deplib' seems to be moved"
++ #test "$absdir" != "$libdir" && \
++ # func_warning "'$deplib' seems to be moved"
+
+ path=-L$absdir
+ fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch
new file mode 100644
index 000000000..b2239fbad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch
@@ -0,0 +1,27 @@
+If for example you build on a machine with /bin/grep, then restore that sstate
+onto a machine with /usr/bin/grep, things will fail. Simply don't bother
+hardcoding paths.
+
+RP 2015/2/3
+
+Index: libtool-2.4.5/libtoolize.in
+===================================================================
+--- libtool-2.4.5.orig/libtoolize.in
++++ libtool-2.4.5/libtoolize.in
+@@ -40,11 +40,11 @@
+
+ : ${AUTOCONF="autoconf"}
+ : ${AUTOMAKE="automake"}
+-: ${EGREP="@EGREP@"}
+-: ${FGREP="@FGREP@"}
+-: ${GREP="@GREP@"}
+-: ${LN_S="@LN_S@"}
+-: ${SED="@SED@"}
++: ${EGREP="egrep"}
++: ${FGREP="fgrep"}
++: ${GREP="grep"}
++: ${LN_S="ln -s"}
++: ${SED="sed"}
+
+
+ ## -------------------------- ##
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/norm-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/norm-rpath.patch
new file mode 100644
index 000000000..1e4c65e02
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/norm-rpath.patch
@@ -0,0 +1,38 @@
+libtool: normalize link paths before considering for RPATH
+
+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.
+
+Signed-off-by: Andy Ross <andy.ross@windriver.com>
+Upstream-Status: Pending
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff -ur a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in 2012-08-16 13:58:55.058900363 -0700
++++ b/build-aux/ltmain.in 2012-08-22 11:01:34.191345989 -0700
+@@ -7288,8 +7288,10 @@
+ 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"
+ ;;
+@@ -8027,8 +8029,10 @@
+ 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/libtool/libtool/prefix.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/prefix.patch
new file mode 100644
index 000000000..a73df2e4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/prefix.patch
@@ -0,0 +1,98 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Renames "libtool" -> "${TARGET_PREFIX}libtool" which makes sure
+it can't be confused with the host libtool.
+
+Originally by: RP
+
+Updated: Date: 2010/06/28
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+It also adjusts libtool so that the header at the script is used for
+script execution and not thevalue of $SHELL. This is because many
+Makefiles change $SHELL so dash can get used to execute what is
+otherwise configured as a bash shell script. Since we don't need to
+execute scipts this way on any system I'm aware of us building upon,
+the simplest fix is just to remove $SHELL.
+
+Updated: Date: 2011/11/09
+RP
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/Makefile.am b/Makefile.am
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -31,7 +31,7 @@ SUBDIRS = .
+ DIST_SUBDIRS = $(SUBDIRS)
+ EXTRA_DIST =
+
+-BUILT_SOURCES = libtool libtoolize
++BUILT_SOURCES = $(host_alias)-libtool libtoolize
+
+ CLEANFILES =
+ MOSTLYCLEANFILES =
+@@ -67,7 +67,7 @@ build_scripts = $(srcdir)/$(aux_dir)/announce-gen \
+
+ EXTRA_DIST += bootstrap bootstrap.conf $(build_scripts) cfg.mk maint.mk \
+ GNUmakefile
+-CLEANFILES += libtool libtoolize
++CLEANFILES += $(host_alias)-libtool libtoolize
+
+ ## If a file is named several times below, and especially if it
+ ## is a distributed file created during Libtool bootstrap, we
+@@ -276,7 +276,7 @@ configure_edit = $(bootstrap_edit) \
+ -e 's|@srcdir\@|$(srcdir)|g'
+
+ # The libtool distributor and the standalone libtool script.
+-bin_SCRIPTS = libtool
++bin_SCRIPTS = $(host_alias)-libtool
+
+ libtoolize: $(libtoolize_in) $(config_status)
+ $(AM_V_at)rm -f '$@'
+@@ -287,7 +287,7 @@ libtoolize: $(libtoolize_in) $(config_status)
+ # We used to do this with a 'stamp-vcl' file, but non-gmake builds
+ # would rerun configure on every invocation, so now we manually
+ # check the version numbers from the build rule when necessary.
+-libtool: $(ltmain_sh) $(config_status) $(dotversion)
++$(host_alias)-libtool: $(ltmain_sh) $(config_status) $(dotversion)
+ @$(rebuild); \
+ if test -f '$@'; then \
+ eval `'$(SED)' -n '/^package_revision=/p' '$@'`; \
+@@ -731,12 +731,12 @@ TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
+
+ BUILDCHECK_ENVIRONMENT = _lt_pkgdatadir="$(abs_top_srcdir)" \
+ LIBTOOLIZE="$(abs_top_builddir)/libtoolize" \
+- LIBTOOL="$(abs_top_builddir)/libtool" \
++ LIBTOOL="$(abs_top_builddir)/$(host_alias)-libtool" \
+ tst_aclocaldir="$(abs_top_srcdir)/m4"
+
+ INSTALLCHECK_ENVIRONMENT = \
+ LIBTOOLIZE="$(bindir)/`echo libtoolize |$(SED) '$(program_transform_name)'`" \
+- LIBTOOL="$(bindir)/`echo libtool |$(SED) '$(program_transform_name)'`" \
++ LIBTOOL="$(bindir)/`echo $(host_alias)-libtool |$(SED) '$(program_transform_name)'`" \
+ LTDLINCL="-I$(includedir)" \
+ LIBLTDL="$(libdir)/libltdl.la" \
+ tst_aclocaldir="$(aclocaldir)"
+diff --git a/m4/libtool.m4 b/m4/libtool.m4
+--- a/m4/libtool.m4
++++ b/m4/libtool.m4
+@@ -86,7 +86,8 @@ _LT_SET_OPTIONS([$0], [$1])
+ LIBTOOL_DEPS=$ltmain
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ AC_SUBST(LIBTOOL)dnl
+
+ _LT_SETUP
+@@ -199,7 +200,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,
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch
new file mode 100644
index 000000000..ad2b11053
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch
@@ -0,0 +1,166 @@
+Upstream-Status: Pending
+
+This patch renames the --with-sysroot option to --with-libtool-sysroot
+to avoid namespace conflict with binutils, gcc and other toolchain
+components.
+
+I also reported the problem to libtool here
+
+http://lists.gnu.org/archive/html/libtool/2010-10/msg00048.html
+
+-Khem Raj <raj.khem@gmail.com>
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/m4/libtool.m4 b/m4/libtool.m4
+--- a/m4/libtool.m4
++++ b/m4/libtool.m4
+@@ -1215,28 +1215,28 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+ # ----------------
+ AC_DEFUN([_LT_WITH_SYSROOT],
+ [AC_MSG_CHECKING([for sysroot])
+-AC_ARG_WITH([sysroot],
+-[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
++AC_ARG_WITH([libtool-sysroot],
++[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
+ [Search for dependent libraries within DIR (or the compiler's sysroot
+ if not specified).])],
+-[], [with_sysroot=no])
++[], [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_sysroot in #(
++case $with_libtool_sysroot in #(
+ yes)
+ if test yes = "$GCC"; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+- AC_MSG_RESULT([$with_sysroot])
++ AC_MSG_RESULT([$with_libtool_sysroot])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+ esac
+diff --git a/tests/sysroot.at b/tests/sysroot.at
+--- a/tests/sysroot.at
++++ b/tests/sysroot.at
+@@ -64,7 +64,7 @@ while read file; do
+ done])
+
+ LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
+-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
+
+ #???
+ if test PATH = "$shlibpath_var"; then
+@@ -114,7 +114,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([lib2.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ ]])
+@@ -155,7 +155,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([prog.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ ]])
+diff --git a/tests/testsuite b/tests/testsuite
+--- a/tests/testsuite
++++ b/tests/testsuite
+@@ -48945,7 +48945,7 @@ $at_traceon; }
+
+
+ LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
+-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
+
+ #???
+ if test PATH = "$shlibpath_var"; then
+@@ -49154,7 +49154,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([lib2.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -49342,7 +49342,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([prog.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -49694,7 +49694,7 @@ $at_traceon; }
+
+
+ LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
+-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
+
+ #???
+ if test PATH = "$shlibpath_var"; then
+@@ -49903,7 +49903,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([lib2.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -50091,7 +50091,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([prog.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -50443,7 +50443,7 @@ $at_traceon; }
+
+
+ LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
+-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
+
+ #???
+ if test PATH = "$shlibpath_var"; then
+@@ -50652,7 +50652,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([lib2.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -50840,7 +50840,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([prog.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/trailingslash.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/trailingslash.patch
new file mode 100644
index 000000000..e8824d7db
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/trailingslash.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+A command like /bin/sh ../../i586-poky-linux-libtool --mode=install /usr/bin/install -c gck-roots-store-standalone.la '/media/data1/builds/poky1/tmp/work/core2-poky-linux/gnome-keyring-2.26.1-r1/image/usr/lib/gnome-keyring/standalone/' fails (e.g. gnome-keyring or pulseaudio)
+
+This is because libdir has a trailing slash which breaks the comparision.
+
+RP 2/1/10
+
+Merged a patch received from Gary Thomas <gary@mlbassoc.com>
+
+Date: 2010/07/12
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -2356,8 +2356,15 @@ func_mode_install ()
+ 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
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch
new file mode 100644
index 000000000..b633bc41b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch
@@ -0,0 +1,179 @@
+Cut and paste the pieces of build-aux/options-parser inline into the main
+ltmain.sh code. This removes a performance degradation caused by the
+repeated calls to func_quote_for_eval, the mechanism funclib uses
+to construct the functions used for option parsing.
+
+Upstream-Status: Submitted [Being discussed on mailing list Feb 2015]
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+index d5cf07a..0f54303 100644
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -342,11 +342,15 @@ _LT_EOF
+ # libtool_options_prep [ARG]...
+ # -----------------------------
+ # Preparation for options parsed by libtool.
+-libtool_options_prep ()
+-{
++#libtool_options_prep ()
++#{
+ $debug_mode
+
+ # Option defaults:
++ opt_verbose=false
++ opt_warning_types=
++
++ # Option defaults:
+ opt_config=false
+ opt_dlopen=
+ opt_dry_run=false
+@@ -382,19 +386,14 @@ libtool_options_prep ()
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+ esac
+-
+- # Pass back the list of options.
+- func_quote_for_eval ${1+"$@"}
+- libtool_options_prep_result=$func_quote_for_eval_result
+-}
+-func_add_hook func_options_prep libtool_options_prep
++#}
+
+
+ # libtool_parse_options [ARG]...
+ # ---------------------------------
+ # Provide handling for libtool specific options.
+-libtool_parse_options ()
+-{
++#libtool_parse_options ()
++#{
+ $debug_cmd
+
+ # Perform our own loop to consume as many options as possible in
+@@ -474,29 +473,90 @@ libtool_parse_options ()
+ func_append preserve_args " $_G_opt"
+ ;;
+
+- # An option not handled by this hook function:
+- *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+- esac
+- done
++ --debug|-x) debug_cmd='set -x'
++ func_echo "enabling shell trace mode"
++ $debug_cmd
++ ;;
+
++ --no-warnings|--no-warning|--no-warn)
++ set dummy --warnings none ${1+"$@"}
++ shift
++ ;;
+
+- # save modified positional parameters for caller
+- func_quote_for_eval ${1+"$@"}
+- libtool_parse_options_result=$func_quote_for_eval_result
+-}
+-func_add_hook func_parse_options libtool_parse_options
++ --warnings|--warning|-W)
++ test $# = 0 && func_missing_arg $_G_opt && break
++ case " $warning_categories $1" in
++ *" $1 "*)
++ # trailing space prevents matching last $1 above
++ func_append_uniq opt_warning_types " $1"
++ ;;
++ *all)
++ opt_warning_types=$warning_categories
++ ;;
++ *none)
++ opt_warning_types=none
++ warning_func=:
++ ;;
++ *error)
++ opt_warning_types=$warning_categories
++ warning_func=func_fatal_error
++ ;;
++ *)
++ func_fatal_error \
++ "unsupported warning category: '$1'"
++ ;;
++ esac
++ shift
++ ;;
++
++ --verbose|-v) opt_verbose=: ;;
++ --version) func_version ;;
++ -\?|-h) func_usage ;;
++ --help) func_help ;;
++
++ # Separate optargs to long options (plugins may need this):
++ --*=*) func_split_equals "$_G_opt"
++ set dummy "$func_split_equals_lhs" \
++ "$func_split_equals_rhs" ${1+"$@"}
++ shift
++ ;;
++
++ # Separate optargs to short options:
++ -W*)
++ func_split_short_opt "$_G_opt"
++ set dummy "$func_split_short_opt_name" \
++ "$func_split_short_opt_arg" ${1+"$@"}
++ shift
++ ;;
++
++ # Separate non-argument short options:
++ -\?*|-h*|-v*|-x*)
++ func_split_short_opt "$_G_opt"
++ set dummy "$func_split_short_opt_name" \
++ "-$func_split_short_opt_arg" ${1+"$@"}
++ shift
++ ;;
++
++ --) break ;;
++ -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
++ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
++ esac
++ done
++#}
+
++# Display all warnings if -W was not given.
++test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
+
+
+ # libtool_validate_options [ARG]...
+ # ---------------------------------
+ # Perform any sanity checks on option settings and/or unconsumed
+ # arguments.
+-libtool_validate_options ()
+-{
++#libtool_validate_options ()
++#{
+ # save first non-option argument
+ if test 0 -lt $#; then
+- nonopt=$1
++ nonopt=$_G_opt
+ shift
+ fi
+
+@@ -537,20 +597,10 @@ libtool_validate_options ()
+ generic_help=$help
+ help="Try '$progname --help --mode=$opt_mode' for more information."
+ }
++#}
+
+- # Pass back the unparsed argument list
+- func_quote_for_eval ${1+"$@"}
+- libtool_validate_options_result=$func_quote_for_eval_result
+-}
+-func_add_hook func_validate_options libtool_validate_options
+-
+-
+-# Process options as early as possible so that --help and --version
+-# can return quickly.
+-func_options ${1+"$@"}
+-eval set dummy "$func_options_result"; shift
+-
+-
++# Bail if the options were screwed!
++$exit_cmd $EXIT_FAILURE
+
+ ## ----------- ##
+ ## Main. ##
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch
new file mode 100644
index 000000000..6af99f327
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Pending
+
+When using sysroot we should append it to libdir, which is helpful in
+cross builds as the system is staged in the sysroot. For normal builds,
+i.e. when lt_sysroot is not set, it will still behave the same and add
+-L/usr/lib to the relink command.
+
+-Khem Raj <raj.khem@gmail.com>
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -6421,7 +6421,7 @@ 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
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
new file mode 100644
index 000000000..3851ec7f8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb
@@ -0,0 +1,27 @@
+require libtool-${PV}.inc
+
+RDEPENDS_${PN} += "bash"
+
+#
+# We want the results of libtool-cross preserved - don't stage anything ourselves.
+#
+SYSROOT_PREPROCESS_FUNCS += "libtool_sysroot_preprocess"
+
+do_install_append () {
+ sed -e 's@--sysroot=${STAGING_DIR_HOST}@@g' \
+ -e 's@${STAGING_DIR_HOST}@@g' \
+ -e 's@${STAGING_DIR_NATIVE}@@g' \
+ -e 's@^\(sys_lib_search_path_spec="\).*@\1${libdir} ${base_libdir}"@' \
+ -e 's@^\(compiler_lib_search_dirs="\).*@\1${libdir} ${base_libdir}"@' \
+ -e 's@^\(compiler_lib_search_path="\).*@\1${libdir} ${base_libdir}"@' \
+ -e 's@^\(predep_objects="\).*@\1"@' \
+ -e 's@^\(postdep_objects="\).*@\1"@' \
+ -i ${D}${bindir}/libtool
+}
+
+libtool_sysroot_preprocess () {
+ rm -rf ${SYSROOT_DESTDIR}${bindir}/*
+ rm -rf ${SYSROOT_DESTDIR}${datadir}/aclocal/*
+ rm -rf ${SYSROOT_DESTDIR}${datadir}/libtool/build-aux/*
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb b/import-layers/yocto-poky/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb
new file mode 100644
index 000000000..508eade32
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb
@@ -0,0 +1,31 @@
+require libtool-${PV}.inc
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/libtool:"
+
+SRC_URI += "file://prefix.patch"
+SRC_URI += "file://fixinstall.patch"
+
+inherit nativesdk
+
+S = "${WORKDIR}/libtool-${PV}"
+FILES_${PN} += "${datadir}/libtool/*"
+
+do_configure_prepend () {
+ # Remove any existing libtool m4 since old stale versions would break
+ # any upgrade
+ rm -f ${STAGING_DATADIR}/aclocal/libtool.m4
+ rm -f ${STAGING_DATADIR}/aclocal/lt*.m4
+}
+
+do_install () {
+ autotools_do_install
+ install -d ${D}${bindir}/
+ install -m 0755 ${HOST_SYS}-libtool ${D}${bindir}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "libtoolnativesdk_sysroot_preprocess"
+
+libtoolnativesdk_sysroot_preprocess () {
+ install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+ install -m 755 ${D}${bindir}/${HOST_SYS}-libtool ${SYSROOT_DESTDIR}${bindir_crossscripts}/${HOST_SYS}-libtool
+}
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
new file mode 100644
index 000000000..a8a90fc82
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools-native_0.9.69.bb
@@ -0,0 +1,25 @@
+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 = "${DEBIAN_MIRROR}/main/l/linuxdoc-tools/linuxdoc-tools_${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"
+
+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
new file mode 100644
index 000000000..490b36799
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_dvips_doc.patch
@@ -0,0 +1,33 @@
+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
new file mode 100644
index 000000000..50c8a8f3f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_sgml2rtf.patch
@@ -0,0 +1,64 @@
+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
new file mode 100644
index 000000000..b62895c67
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_tex_doc.patch
@@ -0,0 +1,29 @@
+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
new file mode 100644
index 000000000..8d784110d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_txt_doc.patch
@@ -0,0 +1,36 @@
+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
new file mode 100644
index 000000000..8ea4e0490
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.17.inc
@@ -0,0 +1,18 @@
+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.9.inc b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.9.inc
new file mode 100644
index 000000000..aab2c1efa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-1.4.9.inc
@@ -0,0 +1,13 @@
+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.17.bb
new file mode 100644
index 000000000..06d8aa244
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4-native_1.4.17.bb
@@ -0,0 +1,13 @@
+require m4-${PV}.inc
+
+inherit native
+
+INHIBIT_AUTOTOOLS_DEPS = "1"
+DEPENDS += "gnu-config-native"
+
+do_configure() {
+ install -m 0644 ${STAGING_DATADIR}/gnu-config/config.sub .
+ install -m 0644 ${STAGING_DATADIR}/gnu-config/config.guess .
+ oe_runconf
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4.inc b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4.inc
new file mode 100644
index 000000000..4a83929f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4.inc
@@ -0,0 +1,10 @@
+SUMMARY = "Traditional Unix macro processor"
+DESCRIPTION = "GNU m4 is an implementation of the traditional Unix macro processor. It is mostly SVR4 \
+compatible although it has some extensions (for example, handling more than 9 positional parameters to macros). \
+GNU M4 also has built-in functions for including files, running shell commands, doing arithmetic, etc."
+
+inherit autotools texinfo
+
+EXTRA_OEMAKE += "'infodir=${infodir}'"
+LDFLAGS_prepend_libc-uclibc = " -lrt "
+SRC_URI = "${GNU_MIRROR}/m4/m4-${PV}.tar.gz"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/ac_config_links.patch b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/ac_config_links.patch
new file mode 100644
index 000000000..275c0b2e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/ac_config_links.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Inappropriate [configuration]
+
+This patch fixes a build problem for m4-native experienced on Ubuntu 9.10,
+where autoconf/automake (AC_CONFIG_LINKS) ends up making GNUmakefile a
+symlink to itself.
+
+The patch comments out ac_config_links directly in configure,
+as autoreconf is not actually run for m4-native.
+
+I believe it should be safe, as GNUmakefile is actually unpacked from
+source, and what we want is to is to not touch it.
+
+Tested on x86_64_linux (Ubuntu 8.04 and 9.10).
+
+2009-11-10 Esben Haabendal <eha@doredevelopment.dk>
+
+diff -urN m4-1.4.13.orig/configure m4-1.4.13/configure
+--- m4-1.4.13.orig/configure 2009-11-10 10:54:00.301707097 +0100
++++ m4-1.4.13/configure 2009-11-10 10:54:17.314206379 +0100
+@@ -14860,8 +14860,8 @@
+ # only, it does not matter if we skip the link with older autoconf.
+ # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
+ # builds, so use a shell variable to bypass this.
+- GNUmakefile=GNUmakefile
+- ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"
++ # GNUmakefile=GNUmakefile
++ # ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"
+
+
+
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
new file mode 100644
index 000000000..98774535d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/fix_for_circular_dependency.patch
@@ -0,0 +1,77 @@
+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
new file mode 100644
index 000000000..effb353f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4/remove-gets.patch
@@ -0,0 +1,23 @@
+eglibc has remove gets starting 2.16
+therefore check for its being there before
+undefining it.
+
+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 @@
+ /* 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
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
++#endif
+
+
+ #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
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.17.bb
new file mode 100644
index 000000000..b12c0adf3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.17.bb
@@ -0,0 +1,3 @@
+require m4-${PV}.inc
+
+BBCLASSEXTEND = "nativesdk"
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
new file mode 100644
index 000000000..b12c0adf3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/m4/m4_1.4.9.bb
@@ -0,0 +1,3 @@
+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
new file mode 100644
index 000000000..9b2e96431
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/make_fix_for_automake-1.12.patch
@@ -0,0 +1,43 @@
+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
new file mode 100644
index 000000000..5dd760467
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/make/make-3.81/makeinfo.patch
@@ -0,0 +1,22 @@
+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-4.1/0001-main.c-main-SV-43434-Handle-NULL-returns-from-ttynam.patch b/import-layers/yocto-poky/meta/recipes-devtools/make/make-4.1/0001-main.c-main-SV-43434-Handle-NULL-returns-from-ttynam.patch
new file mode 100644
index 000000000..7a5f4ba05
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/make/make-4.1/0001-main.c-main-SV-43434-Handle-NULL-returns-from-ttynam.patch
@@ -0,0 +1,63 @@
+From 292da6f6867b75a5af7ddbb639a1feae022f438f Mon Sep 17 00:00:00 2001
+From: Paul Smith <psmith@gnu.org>
+Date: Mon, 20 Oct 2014 01:54:56 -0400
+Subject: [PATCH] * main.c (main): [SV 43434] Handle NULL returns from
+ ttyname().
+
+Upstream-Status: Backport
+
+From: http://git.savannah.gnu.org/cgit/make.git/commit/?id=292da6f6867b75a5af7ddbb639a1feae022f438f
+
+---
+ main.c | 15 ++++++++++-----
+ makeint.h | 3 ++-
+ 2 files changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/main.c b/main.c
+index b2d169c..0cdb8a8 100644
+--- a/main.c
++++ b/main.c
+@@ -1429,13 +1429,18 @@ main (int argc, char **argv, char **envp)
+ #ifdef HAVE_ISATTY
+ if (isatty (fileno (stdout)))
+ if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMOUT")))
+- define_variable_cname ("MAKE_TERMOUT", TTYNAME (fileno (stdout)),
+- o_default, 0)->export = v_export;
+-
++ {
++ const char *tty = TTYNAME (fileno (stdout));
++ define_variable_cname ("MAKE_TERMOUT", tty ? tty : DEFAULT_TTYNAME,
++ o_default, 0)->export = v_export;
++ }
+ if (isatty (fileno (stderr)))
+ if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMERR")))
+- define_variable_cname ("MAKE_TERMERR", TTYNAME (fileno (stderr)),
+- o_default, 0)->export = v_export;
++ {
++ const char *tty = TTYNAME (fileno (stderr));
++ define_variable_cname ("MAKE_TERMERR", tty ? tty : DEFAULT_TTYNAME,
++ o_default, 0)->export = v_export;
++ }
+ #endif
+
+ /* Reset in case the switches changed our minds. */
+diff --git a/makeint.h b/makeint.h
+index 6223936..2009f41 100644
+--- a/makeint.h
++++ b/makeint.h
+@@ -436,10 +436,11 @@ extern struct rlimit stack_limit;
+ /* The number of bytes needed to represent the largest integer as a string. */
+ #define INTSTR_LENGTH CSTRLEN ("18446744073709551616")
+
++#define DEFAULT_TTYNAME "true"
+ #ifdef HAVE_TTYNAME
+ # define TTYNAME(_f) ttyname (_f)
+ #else
+-# define TTYNAME(_f) "true"
++# define TTYNAME(_f) DEFAULT_TTYNAME
+ #endif
+
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/make/make.inc b/import-layers/yocto-poky/meta/recipes-devtools/make/make.inc
new file mode 100644
index 000000000..849b74299
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/make/make.inc
@@ -0,0 +1,12 @@
+SUMMARY = "GNU tool that controls the build process"
+DESCRIPTION = "Make is a tool which controls the generation of executables and other non-source files of a \
+program from the program's source files. Make gets its knowledge of how to build your program from a file \
+called the makefile, which lists each of the non-source files and how to compute it from other files."
+HOMEPAGE = "http://www.gnu.org/software/make/"
+SECTION = "devel"
+
+SRC_URI = "${GNU_MIRROR}/make/make-${PV}.tar.bz2"
+
+inherit autotools gettext pkgconfig texinfo
+
+PROVIDES = "virtual/make"
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
new file mode 100644
index 000000000..b8a79b0eb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/make/make_3.81.bb
@@ -0,0 +1,15 @@
+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/make/make_4.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/make/make_4.1.bb
new file mode 100644
index 000000000..78fe0b547
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/make/make_4.1.bb
@@ -0,0 +1,14 @@
+LICENSE = "GPLv3 & LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://tests/COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://glob/COPYING.LIB;md5=4a770b67e6be0f60da244beb2de0fce4"
+require make.inc
+
+SRC_URI += "file://0001-main.c-main-SV-43434-Handle-NULL-returns-from-ttynam.patch"
+
+EXTRA_OECONF += "--without-guile"
+
+SRC_URI[md5sum] = "57a7a224a822f94789a587ccbcedff69"
+SRC_URI[sha256sum] = "0bc7613389650ee6a24554b52572a272f7356164fd2c4132b0bcf13123e4fca5"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/COPYING.patch b/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/COPYING.patch
new file mode 100644
index 000000000..3a8902b97
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/COPYING.patch
@@ -0,0 +1,346 @@
+Upstream-Status: Inappropriate [licensing]
+
+diff -ruN makedevs-1.0.0-orig/COPYING makedevs-1.0.0/COPYING
+--- makedevs-1.0.0-orig/COPYING 1970-01-01 08:00:00.000000000 +0800
++++ makedevs-1.0.0/COPYING 2010-12-09 16:42:20.274984665 +0800
+@@ -0,0 +1,340 @@
++ GNU GENERAL PUBLIC LICENSE
++ Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
++ 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library General
++Public License instead of this License.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/makedevs.c b/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/makedevs.c
new file mode 100644
index 000000000..771f33ef5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs/makedevs.c
@@ -0,0 +1,589 @@
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <time.h>
+#include <getopt.h>
+#include <libgen.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#define MINORBITS 8
+#define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi))
+#define MAX_ID_LEN 40
+#define MAX_NAME_LEN 40
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+#define VERSION "1.0.1"
+
+/* These are all stolen from busybox's libbb to make
+ * error handling simpler (and since I maintain busybox,
+ * I'm rather partial to these for error handling).
+ * -Erik
+ */
+static const char *const app_name = "makedevs";
+static const char *const memory_exhausted = "memory exhausted";
+static char default_rootdir[]=".";
+static char *rootdir = default_rootdir;
+static int trace = 0;
+
+struct name_id {
+ char name[MAX_NAME_LEN+1];
+ unsigned long id;
+ struct name_id *next;
+};
+
+static struct name_id *usr_list = NULL;
+static struct name_id *grp_list = NULL;
+
+static void verror_msg(const char *s, va_list p)
+{
+ fflush(stdout);
+ fprintf(stderr, "%s: ", app_name);
+ vfprintf(stderr, s, p);
+}
+
+static void error_msg_and_die(const char *s, ...)
+{
+ va_list p;
+
+ va_start(p, s);
+ verror_msg(s, p);
+ va_end(p);
+ putc('\n', stderr);
+ exit(EXIT_FAILURE);
+}
+
+static void vperror_msg(const char *s, va_list p)
+{
+ int err = errno;
+
+ if (s == 0)
+ s = "";
+ verror_msg(s, p);
+ if (*s)
+ s = ": ";
+ fprintf(stderr, "%s%s\n", s, strerror(err));
+}
+
+static void perror_msg_and_die(const char *s, ...)
+{
+ va_list p;
+
+ va_start(p, s);
+ vperror_msg(s, p);
+ va_end(p);
+ exit(EXIT_FAILURE);
+}
+
+static FILE *xfopen(const char *path, const char *mode)
+{
+ FILE *fp;
+
+ if ((fp = fopen(path, mode)) == NULL)
+ perror_msg_and_die("%s", path);
+ return fp;
+}
+
+static char *xstrdup(const char *s)
+{
+ char *t;
+
+ if (s == NULL)
+ return NULL;
+
+ t = strdup(s);
+
+ if (t == NULL)
+ error_msg_and_die(memory_exhausted);
+
+ return t;
+}
+
+static struct name_id* alloc_node(void)
+{
+ struct name_id *node;
+ node = (struct name_id*)malloc(sizeof(struct name_id));
+ if (node == NULL) {
+ error_msg_and_die(memory_exhausted);
+ }
+ memset((void *)node->name, 0, MAX_NAME_LEN+1);
+ node->id = 0xffffffff;
+ node->next = NULL;
+ return node;
+}
+
+static struct name_id* parse_line(char *line)
+{
+ char *p;
+ int i;
+ char id_buf[MAX_ID_LEN+1];
+ struct name_id *node;
+ node = alloc_node();
+ p = line;
+ i = 0;
+ // Get name field
+ while (*p != ':') {
+ if (i > MAX_NAME_LEN)
+ error_msg_and_die("Name field too long");
+ node->name[i++] = *p++;
+ }
+ node->name[i] = '\0';
+ p++;
+ // Skip the second field
+ while (*p != ':')
+ p++;
+ p++;
+ // Get id field
+ i = 0;
+ while (*p != ':') {
+ if (i > MAX_ID_LEN)
+ error_msg_and_die("ID filed too long");
+ id_buf[i++] = *p++;
+ }
+ id_buf[i] = '\0';
+ node->id = atol(id_buf);
+ return node;
+}
+
+static void get_list_from_file(FILE *file, struct name_id **plist)
+{
+ char *line;
+ int len = 0;
+ size_t length = 256;
+ struct name_id *node, *cur;
+
+ if((line = (char *)malloc(length)) == NULL) {
+ error_msg_and_die(memory_exhausted);
+ }
+
+ while ((len = getline(&line, &length, file)) != -1) {
+ node = parse_line(line);
+ if (*plist == NULL) {
+ *plist = node;
+ cur = *plist;
+ } else {
+ cur->next = node;
+ cur = cur->next;
+ }
+ }
+
+ if (line)
+ free(line);
+}
+
+static unsigned long convert2guid(char *id_buf, struct name_id *search_list)
+{
+ char *p;
+ int isnum;
+ struct name_id *node;
+ p = id_buf;
+ isnum = 1;
+ while (*p != '\0') {
+ if (!isdigit(*p)) {
+ isnum = 0;
+ break;
+ }
+ p++;
+ }
+ if (isnum) {
+ // Check for bad user/group name
+ node = search_list;
+ while (node != NULL) {
+ if (!strncmp(node->name, id_buf, strlen(id_buf))) {
+ fprintf(stderr, "WARNING: Bad user/group name %s detected\n", id_buf);
+ break;
+ }
+ node = node->next;
+ }
+ return (unsigned long)atol(id_buf);
+ } else {
+ node = search_list;
+ while (node != NULL) {
+ if (!strncmp(node->name, id_buf, strlen(id_buf)))
+ return node->id;
+ node = node->next;
+ }
+ error_msg_and_die("No entry for %s in search list", id_buf);
+ }
+}
+
+static void free_list(struct name_id *list)
+{
+ struct name_id *cur;
+ cur = list;
+ while (cur != NULL) {
+ list = cur;
+ cur = cur->next;
+ free(list);
+ }
+}
+
+static void add_new_directory(char *name, char *path,
+ unsigned long uid, unsigned long gid, unsigned long mode)
+{
+ if (trace)
+ fprintf(stderr, "Directory: %s %s UID: %ld GID %ld MODE: %04lo", path, name, uid, gid, mode);
+
+ if (mkdir(path, mode) < 0) {
+ if (EEXIST == errno) {
+ /* Unconditionally apply the mode setting to the existing directory.
+ * XXX should output something when trace */
+ chmod(path, mode & ~S_IFMT);
+ }
+ }
+ if (trace)
+ putc('\n', stderr);
+ chown(path, uid, gid);
+}
+
+static void add_new_device(char *name, char *path, unsigned long uid,
+ unsigned long gid, unsigned long mode, dev_t rdev)
+{
+ int status;
+ struct stat sb;
+
+ if (trace) {
+ fprintf(stderr, "Device: %s %s UID: %ld GID: %ld MODE: %04lo MAJOR: %d MINOR: %d",
+ path, name, uid, gid, mode, (short)(rdev >> 8), (short)(rdev & 0xff));
+ }
+
+ memset(&sb, 0, sizeof(struct stat));
+ status = lstat(path, &sb);
+ if (status >= 0) {
+ /* It is ok for some types of files to not exit on disk (such as
+ * device nodes), but if they _do_ exist, the file type bits had
+ * better match those of the actual file or strange things will happen... */
+ if ((mode & S_IFMT) != (sb.st_mode & S_IFMT)) {
+ if (trace)
+ putc('\n', stderr);
+ error_msg_and_die("%s: existing file (04%o) type does not match specified file type (04%lo)!",
+ path, (sb.st_mode & S_IFMT), (mode & S_IFMT));
+ }
+ if (mode != sb.st_mode) {
+ if (trace)
+ fprintf(stderr, " -- applying new mode 04%lo (old was 04%o)\n", mode & ~S_IFMT, sb.st_mode & ~S_IFMT);
+ /* Apply the mode setting to the existing device node */
+ chmod(path, mode & ~S_IFMT);
+ }
+ else {
+ if (trace)
+ fprintf(stderr, " -- extraneous entry in table\n", path);
+ }
+ }
+ else {
+ mknod(path, mode, rdev);
+ if (trace)
+ putc('\n', stderr);
+
+ }
+
+ chown(path, uid, gid);
+}
+
+static void add_new_file(char *name, char *path, unsigned long uid,
+ unsigned long gid, unsigned long mode)
+{
+ if (trace) {
+ fprintf(stderr, "File: %s %s UID: %ld GID: %ld MODE: %04lo\n",
+ path, name, gid, uid, mode);
+ }
+
+ int fd = open(path,O_CREAT | O_WRONLY, mode);
+ if (fd < 0) {
+ error_msg_and_die("%s: file can not be created!", path);
+ } else {
+ close(fd);
+ }
+ chmod(path, mode);
+ chown(path, uid, gid);
+}
+
+
+static void add_new_fifo(char *name, char *path, unsigned long uid,
+ unsigned long gid, unsigned long mode)
+{
+ if (trace) {
+ printf("Fifo: %s %s UID: %ld GID: %ld MODE: %04lo\n",
+ path, name, gid, uid, mode);
+ }
+
+ int status;
+ struct stat sb;
+
+ memset(&sb, 0, sizeof(struct stat));
+ status = stat(path, &sb);
+
+
+ /* Update the mode if we exist and are a fifo already */
+ if (status >= 0 && S_ISFIFO(sb.st_mode)) {
+ chmod(path, mode);
+ } else {
+ if (mknod(path, mode, 0))
+ error_msg_and_die("%s: file can not be created with mknod!", path);
+ }
+ chown(path, uid, gid);
+}
+
+
+/* device table entries take the form of:
+ <path> <type> <mode> <usr> <grp> <major> <minor> <start> <inc> <count>
+ /dev/mem c 640 0 0 1 1 0 0 -
+ /dev/zero c 644 root root 1 5 - - -
+
+ type can be one of:
+ f A regular file
+ d Directory
+ c Character special device file
+ b Block special device file
+ p Fifo (named pipe)
+
+ I don't bother with symlinks (permissions are irrelevant), hard
+ links (special cases of regular files), or sockets (why bother).
+
+ Regular files must exist in the target root directory. If a char,
+ block, fifo, or directory does not exist, it will be created.
+*/
+static int interpret_table_entry(char *line)
+{
+ char *name;
+ char usr_buf[MAX_ID_LEN];
+ char grp_buf[MAX_ID_LEN];
+ char path[4096], type;
+ unsigned long mode = 0755, uid = 0, gid = 0, major = 0, minor = 0;
+ unsigned long start = 0, increment = 1, count = 0;
+
+ if (0 > sscanf(line, "%40s %c %lo %40s %40s %lu %lu %lu %lu %lu", path,
+ &type, &mode, usr_buf, grp_buf, &major, &minor, &start,
+ &increment, &count))
+ {
+ fprintf(stderr, "%s: sscanf returned < 0 for line '%s'\n", app_name, line);
+ return 1;
+ }
+
+ uid = convert2guid(usr_buf, usr_list);
+ gid = convert2guid(grp_buf, grp_list);
+
+ if (strncmp(path, "/", 1)) {
+ error_msg_and_die("Device table entries require absolute paths");
+ }
+ name = xstrdup(path + 1);
+ /* prefix path with rootdir */
+ sprintf(path, "%s/%s", rootdir, name);
+
+ /* XXX Why is name passed into all of the add_new_*() routines? */
+ switch (type) {
+ case 'd':
+ mode |= S_IFDIR;
+ add_new_directory(name, path, uid, gid, mode);
+ break;
+ case 'f':
+ mode |= S_IFREG;
+ add_new_file(name, path, uid, gid, mode);
+ break;
+ case 'p':
+ mode |= S_IFIFO;
+ add_new_fifo(name, path, uid, gid, mode);
+ break;
+ case 'c':
+ case 'b':
+ mode |= (type == 'c') ? S_IFCHR : S_IFBLK;
+ if (count > 0) {
+ int i;
+ dev_t rdev;
+ char buf[80];
+
+ for (i = start; i < start + count; i++) {
+ sprintf(buf, "%s%d", name, i);
+ sprintf(path, "%s/%s%d", rootdir, name, i);
+ /* FIXME: MKDEV uses illicit insider knowledge of kernel
+ * major/minor representation... */
+ rdev = MKDEV(major, minor + (i - start) * increment);
+ sprintf(path, "%s/%s\0", rootdir, buf);
+ add_new_device(buf, path, uid, gid, mode, rdev);
+ }
+ } else {
+ /* FIXME: MKDEV uses illicit insider knowledge of kernel
+ * major/minor representation... */
+ dev_t rdev = MKDEV(major, minor);
+ add_new_device(name, path, uid, gid, mode, rdev);
+ }
+ break;
+ default:
+ error_msg_and_die("Unsupported file type");
+ }
+ if (name) free(name);
+ return 0;
+}
+
+
+static void parse_device_table(FILE * file)
+{
+ char *line;
+ size_t length = 256;
+ int len = 0;
+
+ if((line = (char *)malloc(length)) == NULL) {
+ error_msg_and_die(memory_exhausted);
+ }
+ /* Looks ok so far. The general plan now is to read in one
+ * line at a time, trim off leading and trailing whitespace,
+ * check for leading comment delimiters ('#') or a blank line,
+ * then try and parse the line as a device table entry. If we fail
+ * to parse things, try and help the poor fool to fix their
+ * device table with a useful error msg... */
+
+ while ((len = getline(&line, &length, file)) != -1) {
+ /* First trim off any whitespace */
+
+ /* trim trailing whitespace */
+ while (len > 0 && isspace(line[len - 1]))
+ line[--len] = '\0';
+
+ /* trim leading whitespace */
+ memmove(line, &line[strspn(line, " \n\r\t\v")], len + 1);
+
+ /* If this is NOT a comment or an empty line, try to interpret it */
+ if (*line != '#' && *line != '\0') interpret_table_entry(line);
+ }
+
+ if (line)
+ free(line);
+}
+
+static int parse_devtable(FILE * devtable)
+{
+ struct stat sb;
+
+ if (lstat(rootdir, &sb)) {
+ perror_msg_and_die("%s", rootdir);
+ }
+ if (chdir(rootdir))
+ perror_msg_and_die("%s", rootdir);
+
+ if (devtable)
+ parse_device_table(devtable);
+
+ return 0;
+}
+
+
+static struct option long_options[] = {
+ {"root", 1, NULL, 'r'},
+ {"help", 0, NULL, 'h'},
+ {"trace", 0, NULL, 't'},
+ {"version", 0, NULL, 'v'},
+ {"devtable", 1, NULL, 'D'},
+ {NULL, 0, NULL, 0}
+};
+
+static char *helptext =
+ "Usage: makedevs [OPTIONS]\n"
+ "Build entries based upon device_table.txt\n\n"
+ "Options:\n"
+ " -r, -d, --root=DIR Build filesystem from directory DIR (default: cwd)\n"
+ " -D, --devtable=FILE Use the named FILE as a device table file\n"
+ " -h, --help Display this help text\n"
+ " -t, --trace Be verbose\n"
+ " -v, --version Display version information\n\n";
+
+
+int main(int argc, char **argv)
+{
+ int c, opt;
+ extern char *optarg;
+ struct stat statbuf;
+ char passwd_path[PATH_MAX];
+ char group_path[PATH_MAX];
+ FILE *passwd_file = NULL;
+ FILE *group_file = NULL;
+ FILE *devtable = NULL;
+ DIR *dir = NULL;
+
+ umask (0);
+
+ if (argc==1) {
+ fprintf(stderr, helptext);
+ exit(1);
+ }
+
+ while ((opt = getopt_long(argc, argv, "D:d:r:htv",
+ long_options, &c)) >= 0) {
+ switch (opt) {
+ case 'D':
+ devtable = xfopen(optarg, "r");
+ if (fstat(fileno(devtable), &statbuf) < 0)
+ perror_msg_and_die(optarg);
+ if (statbuf.st_size < 10)
+ error_msg_and_die("%s: not a proper device table file", optarg);
+ break;
+ case 'h':
+ printf(helptext);
+ exit(0);
+ case 'r':
+ case 'd': /* for compatibility with mkfs.jffs, genext2fs, etc... */
+ if (rootdir != default_rootdir) {
+ error_msg_and_die("root directory specified more than once");
+ }
+ if ((dir = opendir(optarg)) == NULL) {
+ perror_msg_and_die(optarg);
+ } else {
+ closedir(dir);
+ }
+ /* If "/" is specified, use "" because rootdir is always prepended to a
+ * string that starts with "/" */
+ if (0 == strcmp(optarg, "/"))
+ rootdir = xstrdup("");
+ else
+ rootdir = xstrdup(optarg);
+ break;
+
+ case 't':
+ trace = 1;
+ break;
+
+ case 'v':
+ printf("%s: %s\n", app_name, VERSION);
+ exit(0);
+ default:
+ fprintf(stderr, helptext);
+ exit(1);
+ }
+ }
+
+ if (argv[optind] != NULL) {
+ fprintf(stderr, helptext);
+ exit(1);
+ }
+
+ // Get name-id mapping
+ sprintf(passwd_path, "%s/etc/passwd", rootdir);
+ sprintf(group_path, "%s/etc/group", rootdir);
+ if ((passwd_file = fopen(passwd_path, "r")) != NULL) {
+ get_list_from_file(passwd_file, &usr_list);
+ fclose(passwd_file);
+ }
+ if ((group_file = fopen(group_path, "r")) != NULL) {
+ get_list_from_file(group_file, &grp_list);
+ fclose(group_file);
+ }
+
+ // Parse devtable
+ if(devtable) {
+ parse_devtable(devtable);
+ fclose(devtable);
+ }
+
+ // Free list
+ free_list(usr_list);
+ free_list(grp_list);
+
+ return 0;
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb
new file mode 100644
index 000000000..92d5870f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Tool for creating device nodes"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+SECTION = "base"
+SRC_URI = "file://makedevs.c \
+ file://COPYING.patch"
+
+S = "${WORKDIR}"
+
+FILES_${PN}_append_class-nativesdk = " ${datadir}"
+
+do_compile() {
+ ${CC} ${CFLAGS} ${LDFLAGS} -o ${S}/makedevs ${S}/makedevs.c
+}
+
+do_install() {
+ install -d ${D}${base_sbindir}
+ install -m 0755 ${S}/makedevs ${D}${base_sbindir}/makedevs
+}
+
+do_install_append_class-nativesdk() {
+ install -d ${D}${datadir}
+ install -m 644 ${COREBASE}/meta/files/device_table-minimal.txt ${D}${datadir}/
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch b/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
new file mode 100644
index 000000000..769270972
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
@@ -0,0 +1,71 @@
+make the tool to be cross compilable.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: mkelfImage/configure.ac
+===================================================================
+--- mkelfImage.orig/configure.ac 2012-07-14 14:04:48.964898667 -0700
++++ mkelfImage/configure.ac 2012-07-14 14:10:47.800916083 -0700
+@@ -70,6 +70,9 @@
+ AC_MSG_ERROR([cc not found])
+ fi
+ eval "${with_default}_CC='$CC'"
++ if test "x$HOST_CC" = 'x'; then
++ AC_CHECK_PROG([HOST_CC], [$CC], [$CC], [gcc], [$PATH])
++ fi
+ AC_PROG_CPP
+ if test "$CPP" = no; then
+ AC_MSG_ERROR([cpp not found])
+@@ -172,7 +175,6 @@
+
+ dnl ---Output variables...
+
+-HOST_CC=$CC
+ HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS)"
+
+ dnl TODO: figure out how to set these appropriately for compilers other than gcc
+Index: mkelfImage/linux-i386/Makefile
+===================================================================
+--- mkelfImage.orig/linux-i386/Makefile 2012-07-14 14:04:48.964898667 -0700
++++ mkelfImage/linux-i386/Makefile 2012-07-14 14:04:49.032898671 -0700
+@@ -4,7 +4,7 @@
+
+ $(LI386_OBJ)/mkelf-linux-i386.o: $(LI386_DIR)/mkelf-linux-i386.c $(LI386_DIR)/convert.bin.c $(LI386_DEP)
+ $(MKDIR) -p $(@D)
+- $(HOST_CC) $(HOST_CFLAGS) -c -g $< -o $@
++ $(CC) $(HOST_CFLAGS) -c -g $< -o $@
+
+
+ ifdef I386_CC
+Index: mkelfImage/linux-ia64/Makefile
+===================================================================
+--- mkelfImage.orig/linux-ia64/Makefile 2012-07-14 14:04:48.964898667 -0700
++++ mkelfImage/linux-ia64/Makefile 2012-07-14 14:04:49.032898671 -0700
+@@ -4,7 +4,7 @@
+
+ $(LIA64_OBJ)/mkelf-linux-ia64.o: $(LIA64_DIR)/mkelf-linux-ia64.c $(LIA64_DIR)/convert.bin.c $(LIA64_DEP)
+ $(MKDIR) -p $(@D)
+- $(HOST_CC) $(HOST_CFLAGS) -c -g $< -o $@
++ $(CC) $(HOST_CFLAGS) -c -g $< -o $@
+
+ ifdef IA64_CC
+
+Index: mkelfImage/main/Makefile
+===================================================================
+--- mkelfImage.orig/main/Makefile 2012-07-14 14:04:48.964898667 -0700
++++ mkelfImage/main/Makefile 2012-07-14 14:04:49.032898671 -0700
+@@ -4,11 +4,11 @@
+
+ $(OBJDIR)/sbin/mkelfImage: $(MKELF_OBJS) $(DEPS)
+ $(MKDIR) -p $(@D)
+- $(HOST_CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS)
++ $(CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS)
+
+ $(OBJDIR)/main/mkelfImage.o: main/mkelfImage.c include/mkelfImage.h $(DEPS)
+ $(MKDIR) -p $(@D)
+- $(HOST_CC) $(HOST_CFLAGS) -c $< -o $@
++ $(CC) $(HOST_CFLAGS) -c $< -o $@
+
+ $(OBJDIR)/man/man8/mkelfImage.8: main/mkelfImage.man
+ $(MKDIR) -p $(@D)
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
new file mode 100644
index 000000000..756a65cd9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch
@@ -0,0 +1,30 @@
+Let makefile find libz and zlib.h by CFLAGS and LDFLAGS.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+---
+diff --git a/configure.ac b/configure.ac
+index d1acc36..6f865b0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -62,7 +62,7 @@ AC_CHECK_PROG([RPM], rpm, rpm, [], [$PATH])
+ AC_CHECK_PROG([SED], sed, sed, [], [$PATH])
+ AC_CHECK_PROG([FIND], find, find, [], [$PATH])
+
+-AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, inflateInit_, [AC_DEFINE(HAVE_ZLIB_H, 1) LIBS="$LIBS -lz"]))
++AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, inflateInit_, [AC_DEFINE(HAVE_ZLIB_H, 1) LIBS="$LIBS $LDFLAGS -lz"]))
+
+ dnl Find the default programs
+ if test "with_default" != no ; then
+@@ -175,7 +175,7 @@ fi
+
+ dnl ---Output variables...
+
+-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
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
new file mode 100644
index 000000000..92435cd1c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Utility for creating ELF boot images for ELF-based Linux kernel images"
+HOMEPAGE = "http://www.coreboot.org/Mkelfimage"
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a"
+
+SRCREV = "686a48a339b3200184c27e7f98d4c03180b2be6c"
+PV = "4.0+git${SRCPV}"
+RECIPE_NO_UPDATE_REASON = "mkelfimage has been removed in coreboot 4.1 release: \
+http://review.coreboot.org/gitweb?p=coreboot.git;a=commit;h=34fc4ab80b507739e2580d490dff67fcfdde11ea"
+
+
+DEPENDS += "zlib"
+
+SRC_URI = "git://review.coreboot.org/p/coreboot;protocol=http \
+ file://cross-compile.patch \
+ "
+SRC_URI_append_class-native = " \
+ file://fix-makefile-to-find-libz.patch \
+"
+
+CLEANBROKEN = "1"
+
+S = "${WORKDIR}/git/util/mkelfImage"
+
+CFLAGS += "-fno-stack-protector"
+CACHED_CONFIGUREVARS += "HOST_CC='${BUILD_CC}'"
+EXTRA_OEMAKE += "HOST_CPPFLAGS='${BUILD_CPPFLAGS}'"
+
+inherit autotools-brokensep
+
+do_install_append() {
+ rmdir ${D}${datadir}/mkelfImage/elf32-i386
+ rmdir ${D}${datadir}/mkelfImage
+ chown root:root ${D}/${sbindir}/mkelfImage
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/ac_init_fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/ac_init_fix.patch
new file mode 100644
index 000000000..422af1042
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/ac_init_fix.patch
@@ -0,0 +1,19 @@
+Get the version of mklibs by simpler means. The MKLIBS_VERSION string in the
+configure.ac file is replaced with real version string by the
+do_configure_prepend() function from the recipe .bb file.
+
+Upstream-Status: Inappropriate [configuration]
+
+Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2011/01/24
+
+Index: mklibs/configure.ac
+===================================================================
+--- mklibs.orig/configure.ac 2010-02-21 17:34:56.000000000 -0800
++++ mklibs/configure.ac 2011-01-24 18:52:19.943242079 -0800
+@@ -1,4 +1,4 @@
+-AC_INIT([mklibs],m4_esyscmd(dpkg-parsechangelog | perl -ne 'print $1 if m/^Version: (.*)$/;'))
++AC_INIT([mklibs], MKLIBS_VERSION)
+ AM_INIT_AUTOMAKE([foreign no-define])
+ AC_CONFIG_HEADERS([config.h])
+ AM_MAINTAINER_MODE
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch
new file mode 100644
index 000000000..7d6d62e77
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch
@@ -0,0 +1,102 @@
+From f172101130604e4a9efa5746f4d8d30de99a0fdc Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <yuanjie.huang@windriver.com>
+Date: Fri, 17 Apr 2015 14:48:20 +0800
+Subject: [PATCH] avoid failure on symbol provided by application
+
+Upstream-Status: Pending
+
+Undefined symbols in a library can be provided by the application
+that links to the library, such as `logsink' in libmultipath.so.0.
+This fix checks the type of object in which the symbol is needed
+and the existence of the symbol in application, when a symbol
+cannot be provided by libraries. It prevents false alarm on absence
+of symbols.
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ src/mklibs | 28 ++++++++++++++++++++++++----
+ 1 file changed, 24 insertions(+), 4 deletions(-)
+
+diff --git a/src/mklibs b/src/mklibs
+index c5614ea..b0d9034 100755
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -133,9 +133,9 @@ class Symbol(object):
+ return '@'.join(ret)
+
+ class UndefinedSymbol(Symbol):
+- def __init__(self, name, weak, version, library):
++ def __init__(self, name, weak, version, library, object):
+ super(UndefinedSymbol, self).__init__(name, version, library)
+- self.weak, self.library = weak, library
++ self.weak, self.library, self.object = weak, library, object
+
+ # Return undefined symbols in an object as a set of tuples (name, weakness)
+ def undefined_symbols(obj):
+@@ -144,6 +144,11 @@ def undefined_symbols(obj):
+
+ output = command("mklibs-readelf", "--print-symbols-undefined", obj)
+
++ if len(obj) > len(dest_path) and obj[:len(dest_path)] == dest_path:
++ object = obj[len(dest_path) + 1:-len('-so-stripped')]
++ else:
++ object = obj
++
+ result = []
+ for line in output:
+ name, weak_string, version_string, library_string = line.split()[:4]
+@@ -160,7 +165,7 @@ def undefined_symbols(obj):
+ if library_string.lower() != 'none':
+ library = library_string
+
+- result.append(UndefinedSymbol(name, weak, version, library))
++ result.append(UndefinedSymbol(name, weak, version, library, object))
+
+ return result
+
+@@ -495,12 +500,13 @@ while 1:
+ and re.search("^ps_", str(symbol)))
+ and not (re.search("ld-linux.so.3$", str(symbol)))
+ and not (re.search("^__gnu_local_gp", str(symbol)))):
+- debug(DEBUG_SPAM, "needed_symbols adding %s, weak: %s" % (symbol, symbol.weak))
++ debug(DEBUG_SPAM, "needed_symbols adding %s, weak: %s, for %s" % (symbol, symbol.weak, obj))
+ needed_symbols[str(symbol)] = symbol
+ libraries.update(library_depends(obj))
+
+ # calculate what symbols are present in small_libs and available_libs
+ present_symbols = {}
++ present_symbol_progs = {}
+ checked_libs = small_libs
+ checked_libs.extend(available_libs)
+ checked_libs.append(ldlib)
+@@ -510,6 +516,12 @@ while 1:
+ names = symbol.base_names()
+ for name in names:
+ present_symbols[name] = symbol
++ if not so_pattern.match(lib):
++ debug(DEBUG_SPAM, "present_symbol_progs adding %s, from executable %s" % (' '.join(names), lib))
++ for name in names:
++ progs = present_symbol_progs.get(name, set())
++ progs.add(lib)
++ present_symbol_progs[name] = progs
+
+ # are we finished?
+ num_unresolved = 0
+@@ -565,6 +577,14 @@ while 1:
+ for name in needed_symbols:
+ if not name in symbol_provider:
+ if not needed_symbols[name].weak:
++ # WORKAROUND: Undefined symbols in a library can be provided by the application
++ # that links to the library. So if the object which requires the symbol is a library
++ # and some application can provide the symbol, the undefined symbol is skipped.
++ symbol = needed_symbols[name]
++ if so_pattern.match(symbol.object) and present_symbol_progs.get(name, None):
++ debug(DEBUG_SPAM, "symbol %s in library %s is provided by executable %s" \
++ % (name, symbol.object, ' '.join(present_symbol_progs[name])))
++ continue
+ raise Exception("No library provides non-weak %s" % name)
+ else:
+ lib = symbol_provider[name]
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch
new file mode 100644
index 000000000..d27a48916
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch
@@ -0,0 +1,26 @@
+The libc6-dev in Ubuntu 9.04 is so old that the elf.h doesn't
+define STT_GNU_IFUNC, so we have to define it ourselves.
+
+Upstream-Status: Inappropriate [other] - old release specific, maybe removable
+
+-- Dexuan Cui (dexuan.cui@intel.com) Feb 16, 2011.
+
+diff --git a/src/mklibs-readelf/main.cpp b/src/mklibs-readelf/main.cpp
+index 2444c39..56d93f8 100644
+--- a/src/mklibs-readelf/main.cpp
++++ b/src/mklibs-readelf/main.cpp
+@@ -6,6 +6,14 @@
+ #include <vector>
+
+ #include <elf.h>
++/*
++ * The /usr/include/elf.h in some distributions(like Ubuntu 9.04) doesn't
++ * define the macro. We need to define it here.
++ */
++#ifndef STT_GNU_IFUNC
++#define STT_GNU_IFUNC 10 /* Symbol is indirect code object */
++#endif
++
+ #include <getopt.h>
+
+ #include "elf.hpp"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch
new file mode 100644
index 000000000..13e4606b8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch
@@ -0,0 +1,81 @@
+Remove dependency on dpkg
+
+Upstream-Status: Submitted
+
+Asking the host OS whether it supports multiarch is not useful
+in a cross-compilation environment, or if the user has specified
+a libdir explicitly. So this patch, based on the work of Mentor
+Graphics, removes mklibs's dependency on dpkg package.
+
+Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+ src/mklibs | 30 +++++++++++++++++++-----------
+ 1 file changed, 19 insertions(+), 11 deletions(-)
+
+diff --git a/src/mklibs b/src/mklibs
+index d9b784b..c5614ea 100755
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -261,6 +261,11 @@ def extract_soname(so_file):
+ return ""
+
+ def multiarch(paths):
++ # Asking the host OS whether it supports multiarch is not useful
++ # in a cross-compilation environment, or if the user has specified
++ # a libdir explicitly.
++ if sysroot != "" or libdir != "":
++ return paths
+ devnull = open('/dev/null', 'w')
+ dpkg_architecture = subprocess.Popen(
+ ['dpkg-architecture', '-qDEB_HOST_MULTIARCH'],
+@@ -340,7 +345,7 @@ lib_path = []
+ dest_path = "DEST"
+ ldlib = "LDLIB"
+ include_default_lib_path = "yes"
+-default_lib_path = multiarch(["/lib/", "/usr/lib/", "/usr/X11R6/lib/"])
++default_lib_path = ["/lib/", "/usr/lib/", "/usr/X11R6/lib/"]
+ libc_extras_dir = "/usr/lib/libc_pic"
+ libc_extras_dir_default = True
+ libdir = "lib"
+@@ -386,7 +391,7 @@ for opt, arg in optlist:
+ elif opt == "--libdir":
+ libdir = arg
+ elif opt in ("--help", "-h"):
+- usage(0)
++ usage(0)
+ sys.exit(0)
+ elif opt in ("--version", "-V"):
+ version(vers)
+@@ -395,6 +400,7 @@ for opt, arg in optlist:
+ print "WARNING: unknown option: " + opt + "\targ: " + arg
+
+ if include_default_lib_path == "yes":
++ default_lib_path = multiarch(default_lib_path)
+ lib_path.extend([a.replace("/lib/", "/" + libdir + "/") for a in default_lib_path])
+
+ if libc_extras_dir_default:
+@@ -661,16 +669,16 @@ ld_path_name = os.path.dirname(ldlib)
+ ld_full_path = "../" + ldlib
+ ld_file = find_lib(ld_file_name)
+
+-if ld_path_name != "/lib":
+- if os.access(dest_path + "/" + ld_file_name, os.F_OK):
+- os.remove(dest_path + "/" + ld_file_name)
++#if ld_path_name != "/lib":
++# if os.access(dest_path + "/" + ld_file_name, os.F_OK):
++# os.remove(dest_path + "/" + ld_file_name)
+
+-if not os.path.exists(dest_path + "/../" + ld_path_name):
+- os.mkdir(dest_path + "/../" + ld_path_name)
++#if not os.path.exists(dest_path + "/../" + ld_path_name):
++# os.mkdir(dest_path + "/../" + ld_path_name)
+
+-if not os.access(dest_path + "/" + ld_full_path, os.F_OK):
+- debug(DEBUG_NORMAL, "I: stripping and copying dynamic linker to " + ld_full_path)
++if not os.access(dest_path + "/" + ld_file_name, os.F_OK):
++ debug(DEBUG_NORMAL, "I: stripping and copying dynamic linker to " + ld_file_name)
+ command(target + "objcopy", "--strip-unneeded -R .note -R .comment",
+- ld_file, dest_path + "/" + ld_full_path)
++ ld_file, dest_path + "/" + ld_file_name)
+
+-os.chmod(dest_path + "/" + ld_full_path, 0755)
++os.chmod(dest_path + "/" + ld_file_name, 0755)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch
new file mode 100644
index 000000000..bc56593e6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch
@@ -0,0 +1,34 @@
+From eddf04c7f8312e9c29cdb24e431b7e4fb2cc70ed Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <yuanjie.huang@windriver.com>
+Date: Wed, 15 Apr 2015 14:00:06 +0800
+Subject: [PATCH] Show GNU unique symbols as provided symbols
+
+Upstream-Status: Submitted
+
+GNU Unique symbol is a GNU extension employed by new version of GCC
+by default. Even Standard C++ library in GCC 4.9 provides some symbols,
+such as _ZNSs4_Rep20_S_empty_rep_storageE in this binding type instead
+of ELF standard weak binding.
+This patch adds support of this new binding type to mklibs-readelf.
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ src/mklibs-readelf/main.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mklibs-readelf/main.cpp b/src/mklibs-readelf/main.cpp
+index 56d93f8..0134530 100644
+--- a/src/mklibs-readelf/main.cpp
++++ b/src/mklibs-readelf/main.cpp
+@@ -88,7 +88,7 @@ static void process_symbols_provided (const Elf::section_type<Elf::section_type_
+ uint8_t type = symbol->get_type ();
+ const std::string &name = symbol->get_name_string ();
+
+- if (bind != STB_GLOBAL && bind != STB_WEAK)
++ if (bind != STB_GLOBAL && bind != STB_WEAK && bind != STB_GNU_UNIQUE)
+ continue;
+ if (shndx == SHN_UNDEF || shndx == SHN_ABS)
+ continue;
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch
new file mode 100644
index 000000000..75500a029
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch
@@ -0,0 +1,18 @@
+In cross builds we will have to respect sysroot
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: mklibs-0.1.39/src/mklibs
+===================================================================
+--- mklibs-0.1.39.orig/src/mklibs 2014-03-01 18:25:36.000000000 +0000
++++ mklibs-0.1.39/src/mklibs 2014-10-19 00:51:46.813534596 +0000
+@@ -495,7 +495,7 @@
+ present_symbols = {}
+ checked_libs = small_libs
+ checked_libs.extend(available_libs)
+- checked_libs.append(ldlib)
++ checked_libs.append(sysroot + ldlib)
+ for lib in checked_libs:
+ for symbol in provided_symbols(lib):
+ debug(DEBUG_SPAM, "present_symbols adding %s" % symbol)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb
new file mode 100644
index 000000000..59fec29a0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb
@@ -0,0 +1,21 @@
+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://ftp.de.debian.org/debian/pool/main/m/mklibs/${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] = "e1dafe5f962caa9dc5f2651c0723812a"
+SRC_URI[sha256sum] = "1db24ae779d21ccfed49f22e49a2b7ee43ec0e9197bc206d81cd02f96e91e125"
+
+inherit autotools gettext native pythonnative
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
new file mode 100644
index 000000000..64b8910a2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mmc/mmc-utils_git.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Userspace tools for MMC/SD devices"
+HOMEPAGE = "http://git.kernel.org/cgit/linux/kernel/git/cjb/mmc-utils.git/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://mmc.c;beginline=1;endline=17;md5=d7747fc87f1eb22b946ef819969503f0"
+
+SRCBRANCH ?= "master"
+SRCREV = "44f94b925894577f9ffcf2c418dd013a5e582648"
+
+PV = "0.1"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git;branch=${SRCBRANCH}"
+
+S = "${WORKDIR}/git"
+
+CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
+CFLAGS_append_mips64 = " -D__SANE_USERSPACE_TYPES__"
+CFLAGS_append_mips64n32 = " -D__SANE_USERSPACE_TYPES__"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 mmc ${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
new file mode 100644
index 000000000..305be5215
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/0001-Fix-build-with-musl.patch
@@ -0,0 +1,29 @@
+From e16fa28bc57c29923ab60af2ac343da83e1992d8 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
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ mkfs.jffs2.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
+ recv_image.c | 1 -
+ serve_image.c | 1 -
+ 3 files changed, 42 insertions(+), 4 deletions(-)
+
+diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c
+index f09c0b2..ed2dc43 100644
+--- a/mkfs.jffs2.c
++++ b/mkfs.jffs2.c
+@@ -72,6 +72,7 @@
+ #include <byteswap.h>
+ #include <crc32.h>
+ #include <inttypes.h>
++#include <limits.h>
+
+ #include "rbtree.h"
+ #include "common.h"
+--
+2.6.1
+
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
new file mode 100644
index 000000000..7d783e7a5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/010-fix-rpmatch.patch
@@ -0,0 +1,24 @@
+Replace rpmatch() usage with checking first character of line
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/include/common.h
++++ b/include/common.h
+@@ -122,10 +122,12 @@
+ }
+
+ if (strcmp("\n", line) != 0) {
+- switch (rpmatch(line)) {
+- case 0: ret = false; break;
+- case 1: ret = true; break;
+- case -1:
++ switch (line[0]) {
++ case 'N':
++ case 'n': ret = false; break;
++ case 'Y':
++ case 'y': ret = true; break;
++ default:
+ puts("unknown response; please try again");
+ continue;
+ }
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
new file mode 100644
index 000000000..57d6a30d8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
@@ -0,0 +1,103 @@
+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
+@@ -100,6 +100,11 @@
+ struct rb_node hardlink_rb;
+ };
+
++struct ignorepath_entry {
++ struct ignorepath_entry* next; /* Points to the next ignorepath element */
++ char name[PATH_MAX]; /* Name of the entry */
++};
++static struct ignorepath_entry* ignorepath = 0;
+ struct rb_root hardlinks;
+ static int out_fd = -1;
+ static int in_fd = -1;
+@@ -408,7 +413,7 @@
+ char *hpath, *tpath;
+ struct dirent *dp, **namelist;
+ struct filesystem_entry *entry;
+-
++ struct ignorepath_entry* element = ignorepath;
+
+ if (lstat(hostpath, &sb)) {
+ perror_msg_and_die("%s", hostpath);
+@@ -417,6 +422,15 @@
+ entry = add_host_filesystem_entry(targetpath, hostpath,
+ sb.st_uid, sb.st_gid, sb.st_mode, 0, parent);
+
++ while ( element ) {
++ if ( strcmp( element->name, targetpath ) == 0 ) {
++ printf( "Note: ignoring directories below '%s'\n", targetpath );
++ return entry;
++ break;
++ }
++ element = element->next;
++ }
++
+ n = scandir(hostpath, &namelist, 0, alphasort);
+ if (n < 0) {
+ perror_msg_and_die("opening directory %s", hostpath);
+@@ -1453,6 +1467,7 @@
+ {"root", 1, NULL, 'r'},
+ {"pagesize", 1, NULL, 's'},
+ {"eraseblock", 1, NULL, 'e'},
++ {"ignore", 1, NULL, 'I'},
+ {"output", 1, NULL, 'o'},
+ {"help", 0, NULL, 'h'},
+ {"verbose", 0, NULL, 'v'},
+@@ -1500,6 +1515,7 @@
+ " -L, --list-compressors Show the list of the avaiable compressors\n"
+ " -t, --test-compression Call decompress and compare with the original (for test)\n"
+ " -n, --no-cleanmarkers Don't add a cleanmarker to every eraseblock\n"
++" -I, --ignore=PATH Ignore sub directory and file tree below PATH when recursing over the file system\n"
+ " -o, --output=FILE Output to FILE (default: stdout)\n"
+ " -l, --little-endian Create a little-endian filesystem\n"
+ " -b, --big-endian Create a big-endian filesystem\n"
+@@ -1666,6 +1682,7 @@
+ char *compr_name = NULL;
+ int compr_prior = -1;
+ int warn_page_size = 0;
++ struct ignorepath_entry* element = ignorepath;
+
+ page_size = sysconf(_SC_PAGESIZE);
+ if (page_size < 0) /* System doesn't know so ... */
+@@ -1676,7 +1693,7 @@
+ jffs2_compressors_init();
+
+ while ((opt = getopt_long(argc, argv,
+- "D:d:r:s:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0)
++ "D:d:r:s:I:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0)
+ {
+ switch (opt) {
+ case 'D':
+@@ -1700,6 +1717,28 @@
+ warn_page_size = 0; /* set by user, so don't need to warn */
+ break;
+
++ case 'I':
++ printf( "Note: Adding '%s' to ignore Path\n", optarg );
++ element = ignorepath;
++ if ( !ignorepath ) {
++ ignorepath = xmalloc( sizeof( struct ignorepath_entry ) );
++ ignorepath->next = 0;
++ strcpy( &ignorepath->name[0], optarg );
++ } else {
++ while ( element->next ) element = element->next;
++ element->next = xmalloc( sizeof( struct ignorepath_entry ) );
++ element->next->next = 0;
++ strcpy( &element->next->name[0], optarg );
++ }
++ printf( "--------- Dumping ignore path list ----------------\n" );
++ element = ignorepath;
++ while ( element ) {
++ printf( " * '%s'\n", &element->name[0] );
++ element = element->next;
++ }
++ printf( "---------------------------------------------------\n" );
++ break;
++
+ case 'o':
+ if (out_fd != -1) {
+ error_msg_and_die("output filename specified more than once");
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
new file mode 100644
index 000000000..05f1629d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
@@ -0,0 +1,44 @@
+Upstream-Status: Pending
+
+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>
+
+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,
+ */
+ static inline void key_write(const union ubifs_key *from, void *to)
+ {
+- union ubifs_key *t = to;
++ __le32 x[2];
+
+- t->j32[0] = cpu_to_le32(from->u32[0]);
+- t->j32[1] = cpu_to_le32(from->u32[1]);
++ x[0] = cpu_to_le32(from->u32[0]);
++ x[1] = cpu_to_le32(from->u32[1]);
++
++ memcpy(to, &x, 8);
+ 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)
+ */
+ static inline void key_write_idx(const union ubifs_key *from, void *to)
+ {
+- union ubifs_key *t = to;
++ __le32 x[2];
++
++ x[0] = cpu_to_le32(from->u32[0]);
++ x[1] = cpu_to_le32(from->u32[1]);
+
+- t->j32[0] = cpu_to_le32(from->u32[0]);
+- t->j32[1] = cpu_to_le32(from->u32[1]);
++ memcpy(to, &x, 8);
+ }
+
+ /**
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
new file mode 100644
index 000000000..7207cfcb3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
@@ -0,0 +1,137 @@
+Upstream-Status: Pending
+From patchwork Mon Aug 8 08:16:43 2011
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: mtd-utils: fix corrupt cleanmarker with flash_erase -j command
+Date: Sun, 07 Aug 2011 22:16:43 -0000
+From: b35362@freescale.com
+X-Patchwork-Id: 108873
+Message-Id: <1312791403-13473-1-git-send-email-b35362@freescale.com>
+To: <dwmw2@infradead.org>
+Cc: Liu Shuo <b35362@freescale.com>, Artem.Bityutskiy@nokia.com,
+ Li Yang <leoli@freescale.com>, linux-mtd@lists.infradead.org
+
+From: Liu Shuo <b35362@freescale.com>
+
+Flash_erase -j should fill discrete freeoob areas with required bytes
+of JFFS2 cleanmarker in jffs2_check_nand_cleanmarker(). Not just fill
+the first freeoob area.
+
+The below is the result without this workaround:
+
+JFFS2: Erase block at 0x00000000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00004000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00008000 is not formatted. It will be erased
+JFFS2: Erase block at 0x0000c000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00010000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00014000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00018000 is not formatted. It will be erased
+JFFS2: Erase block at 0x0001c000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00020000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00024000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00028000 is not formatted. It will be erased
+...
+
+Signed-off-by: Liu Shuo <b35362@freescale.com>
+Signed-off-by: Li Yang <leoli@freescale.com>
+
+Updated for the new version
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+---
+v2 : get length of availble freeoob bytes from oobinfo information,
+ not use the ioctl ECCGETLAYOUT which is being deprecated.
+
+ flash_erase.c | 46 +++++++++++++++++++++++++++++++++++++++-------
+ 1 files changed, 39 insertions(+), 7 deletions(-)
+
+diff --git a/flash_erase.c b/flash_erase.c
+index 933373a..4b9d84b 100644
+--- a/flash_erase.c
++++ b/flash_erase.c
+@@ -99,6 +99,7 @@ int main(int argc, char *argv[])
+ bool isNAND;
+ int error = 0;
+ off_t offset = 0;
++ void *oob_data = NULL;
+
+ /*
+ * Process user arguments
+@@ -201,15 +202,43 @@ int main(int argc, char *argv[])
+ if (ioctl(fd, MEMGETOOBSEL, &oobinfo) != 0)
+ return sys_errmsg("%s: unable to get NAND oobinfo", mtd_device);
+
++ cleanmarker.totlen = cpu_to_je32(8);
+ /* Check for autoplacement */
+ if (oobinfo.useecc == MTD_NANDECC_AUTOPLACE) {
+- /* Get the position of the free bytes */
+- if (!oobinfo.oobfree[0][1])
++ struct nand_ecclayout_user ecclayout;
++ int i, oobavail;
++
++ for (i = 0, oobavail = 0; oobinfo.oobfree[i][1]; i++)
++ oobavail += oobinfo.oobfree[i][1];
++
++ if (!oobavail)
+ return errmsg(" Eeep. Autoplacement selected and no empty space in oob");
++
++ /* Get the position of the free bytes */
+ clmpos = oobinfo.oobfree[0][0];
+- clmlen = oobinfo.oobfree[0][1];
+- if (clmlen > 8)
+- clmlen = 8;
++ clmlen = MIN(oobavail, 8);
++
++ if (oobinfo.oobfree[0][1] < 8 && oobavail >= 8) {
++ int left, n, last = 0;
++ void *cm;
++
++ oob_data = malloc(mtd.oob_size);
++ if (!oob_data)
++ return -ENOMEM;
++
++ memset(oob_data, 0xff, mtd.oob_size);
++ cm = &cleanmarker;
++ for (i = 0, left = clmlen; left ; i++) {
++ n = MIN(left, oobinfo.oobfree[i][1]);
++ memcpy(oob_data + oobinfo.oobfree[i][0],
++ cm, n);
++ left -= n;
++ cm += n;
++ last = oobinfo.oobfree[i][0] + n;
++ }
++
++ clmlen = last - clmpos;
++ }
+ } else {
+ /* Legacy mode */
+ switch (mtd.oob_size) {
+@@ -227,7 +256,6 @@ int main(int argc, char *argv[])
+ break;
+ }
+ }
+- cleanmarker.totlen = cpu_to_je32(8);
+ }
+ cleanmarker.hdr_crc = cpu_to_je32(mtd_crc32(0, &cleanmarker, sizeof(cleanmarker) - 4));
+ }
+@@ -276,7 +304,8 @@ int main(int argc, char *argv[])
+
+ /* write cleanmarker */
+ if (isNAND) {
+- if (mtd_write_oob(mtd_desc, &mtd, fd, (uint64_t)offset + clmpos, clmlen, &cleanmarker) != 0) {
++ void *data = oob_data ? oob_data + clmpos : &cleanmarker;
++ if (mtd_write_oob(mtd_desc, &mtd, fd, (uint64_t)offset + clmpos, clmlen, data) != 0) {
+ sys_errmsg("%s: MTD writeoob failure", mtd_device);
+ continue;
+ }
+@@ -291,5 +320,8 @@ int main(int argc, char *argv[])
+ show_progress(&mtd, offset, eb, eb_start, eb_cnt);
+ bareverbose(!quiet, "\n");
+
++ if (oob_data)
++ free(oob_data);
++
+ return 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
new file mode 100644
index 000000000..cd9ae06ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Tools for managing memory technology devices"
+HOMEPAGE = "http://www.linux-mtd.infradead.org/"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
+
+DEPENDS = "zlib lzo e2fsprogs util-linux"
+
+PV = "1.5.2"
+
+SRCREV = "aea36417067dade75192bafa03af70b6eb2677b1"
+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 \
+"
+
+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[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}'"
+
+do_install () {
+ oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
+}
+
+PACKAGES =+ "mtd-utils-jffs2 mtd-utils-ubifs mtd-utils-misc"
+
+FILES_mtd-utils-jffs2 = "${sbindir}/mkfs.jffs2 ${sbindir}/jffs2dump ${sbindir}/jffs2reader ${sbindir}/sumtool"
+FILES_mtd-utils-ubifs = "${sbindir}/mkfs.ubifs ${sbindir}/ubi*"
+FILES_mtd-utils-misc = "${sbindir}/nftl* ${sbindir}/ftl* ${sbindir}/rfd* ${sbindir}/doc* ${sbindir}/serve_image ${sbindir}/recv_image"
+
+BBCLASSEXTEND = "native"
+
+# git/.compr.c.dep:46: warning: NUL character seen; rest of line ignored
+# git/.compr.c.dep:47: *** missing separator. Stop.
+PARALLEL_MAKE = ""
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
new file mode 100644
index 000000000..cb454917f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/fix-broken-lz.patch
@@ -0,0 +1,23 @@
+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-makeinfo.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch
new file mode 100644
index 000000000..2e2873a4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch
@@ -0,0 +1,65 @@
+Upstream-Status: Inappropriate [licensing]
+
+--- mtools-3.9.9/configure.in.orig 2006-04-14 16:05:54.337655192 -0600
++++ mtools-3.9.9/configure.in 2006-04-14 16:12:29.736545424 -0600
+@@ -21,6 +21,33 @@
+ AC_C_CONST
+ AC_C_INLINE
+
++AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
++if test "x$MAKEINFO" = "x"; then
++ MAKEINFO="@echo makeinfo missing; true"
++fi
++AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, )
++if test "x$TEXI2DVI" = "x"; then
++ TEXI2DVI="@echo texi2dvi missing; true"
++fi
++AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, )
++if test "x$TEXI2PDF" = "x"; then
++ TEXI2PDF="@echo texi2pdf missing; true"
++fi
++AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, )
++if test "x$TEXI2HTML" = "x"; then
++ TEXI2HTML="@echo texi2html missing; true"
++fi
++AC_CHECK_PROG(DVI2PS, dvi2ps, dvi2ps, )
++if test "x$DVI2PS" = "x"; then
++ DVI2PS="@echo dvi2ps missing; true"
++fi
++
++AC_SUBST(MAKEINFO)
++AC_SUBST(TEXI2DVI)
++AC_SUBST(TEXI2PDF)
++AC_SUBST(TEXI2HTML)
++AC_SUBST(DVI2PS)
++
+
+ dnl Check for configuration options
+ dnl Enable OS/2 extended density format disks
+--- mtools-3.9.9/Makefile.in.sav 2006-04-14 15:56:19.000000000 -0600
++++ mtools-3.9.9/Makefile.in 2006-04-14 16:15:29.315245312 -0600
+@@ -11,10 +11,11 @@
+ USERLDFLAGS =
+ USERLDLIBS =
+
+-MAKEINFO = makeinfo
+-TEXI2DVI = texi2dvi
+-TEXI2PDF = texi2pdf
+-TEXI2HTML = texi2html
++MAKEINFO = @MAKEINFO@
++TEXI2DVI = @TEXI2DVI@
++TEXI2PDF = @TEXI2PDF@
++TEXI2HTML = @TEXI2HTML@
++DVI2PS = @DVI2PS@
+
+
+ # do not edit below this line
+@@ -181,7 +182,7 @@
+
+ ps: mtools.ps
+ %.ps: %.dvi
+- dvips -f < $< > $@
++ $(DVI2PS) -f < $< > $@
+
+ pdf: mtools.pdf
+ %.pdf: %.texi
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
new file mode 100644
index 000000000..15a32088d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/mtools.patch
@@ -0,0 +1,129 @@
+$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.gplv3.patch b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.gplv3.patch
new file mode 100644
index 000000000..9cb3e39f5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.gplv3.patch
@@ -0,0 +1,18 @@
+Disable building with X11 support.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN mtools-4.0.15.orig//Makefile.in mtools-4.0.15//Makefile.in
+--- mtools-4.0.15.orig//Makefile.in 2010-10-17 08:41:09.000000000 -0700
++++ mtools-4.0.15//Makefile.in 2010-11-23 13:59:49.258258374 -0800
+@@ -146,7 +146,7 @@
+ 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) -lXau -lX11 $(LIBS)
++X_LDFLAGS = $(X_EXTRA_LIBS) $(X_LIBS) $(LIBS)
+ X_CCFLAGS = $(X_CFLAGS) $(CFLAGS)
+
+ all: mtools $(LINKS) mkmanifest @FLOPPYD@ mtools.1 mtools.5
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
new file mode 100644
index 000000000..705b62944
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools/no-x11.patch
@@ -0,0 +1,21 @@
+---
+ 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
new file mode 100644
index 000000000..3423917d0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_3.9.9.bb
@@ -0,0 +1,53 @@
+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"
+
+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/mtools/mtools_4.0.18.bb b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_4.0.18.bb
new file mode 100644
index 000000000..efde547e2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/mtools/mtools_4.0.18.bb
@@ -0,0 +1,50 @@
+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 = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+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] = "a23646617546bf6ad56f061d8b283c85"
+SRC_URI[sha256sum] = "59e9cf80885399c4f229e5d87e49c0c2bfeec044e1386d59fcd0b0aead6b2f85"
+
+SRC_URI = "${GNU_MIRROR}/mtools/mtools-${PV}.tar.bz2 \
+ file://mtools-makeinfo.patch \
+ file://no-x11.gplv3.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.11.08.bb b/import-layers/yocto-poky/meta/recipes-devtools/nasm/nasm_2.11.08.bb
new file mode 100644
index 000000000..e0724e68a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/nasm/nasm_2.11.08.bb
@@ -0,0 +1,30 @@
+SUMMARY = "General-purpose x86 assembler"
+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 "
+
+SRC_URI[md5sum] = "7aae5cb8e03fac48029c82a7470ab066"
+SRC_URI[sha256sum] = "9da3a0291a0bdc06305b7ba194f1e2c2b55ae6f11210b4af43729868149d5445"
+
+inherit autotools-brokensep
+
+do_configure_prepend () {
+ if [ -f ${S}/aclocal.m4 ] && [ ! -f ${S}/acinclude.m4 ]; then
+ mv ${S}/aclocal.m4 ${S}/acinclude.m4
+ fi
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -d ${D}${mandir}/man1
+
+ oe_runmake 'INSTALLROOT=${D}' install
+}
+
+BBCLASSEXTEND = "native"
+
+DEPENDS = "groff-native"
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
new file mode 100644
index 000000000..6b40afdad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/fix-regex.patch
@@ -0,0 +1,32 @@
+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
new file mode 100644
index 000000000..968b9b47c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/makefile.patch
@@ -0,0 +1,39 @@
+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
new file mode 100644
index 000000000..b47fd4655
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/msggen.pl.patch
@@ -0,0 +1,44 @@
+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
new file mode 100644
index 000000000..2f57c000f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/no-libtool.patch
@@ -0,0 +1,20 @@
+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
new file mode 100644
index 000000000..1a23a4a68
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/reautoconf.patch
@@ -0,0 +1,83 @@
+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
new file mode 100644
index 000000000..073af46fc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-1.3.2/user-declared-default-constructor.patch
@@ -0,0 +1,92 @@
+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
new file mode 100644
index 000000000..bc250080f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb
@@ -0,0 +1,121 @@
+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"
+
+SSTATEPOSTINSTFUNCS += "openjade_sstate_postinst"
+SYSROOT_PREPROCESS_FUNCS += "openjade_sysroot_preprocess"
+CLEANFUNCS += "openjade_sstate_clean"
+
+# 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
+ 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
+}
+
+openjade_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\/openjade-${PV}.cat/d' $f
+ done
+}
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
new file mode 100644
index 000000000..42218a6d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp-1.5.2/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+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
new file mode 100644
index 000000000..60a7d2e47
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opensp/opensp_1.5.2.bb
@@ -0,0 +1,59 @@
+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/0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch
new file mode 100644
index 000000000..5cbb55a7d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch
@@ -0,0 +1,56 @@
+From 8e424296ce2af4a5a7392c38a31f8723f9b9fbda Mon Sep 17 00:00:00 2001
+From: Denys Dmytriyenko <denys@ti.com>
+Date: Thu, 7 Apr 2016 20:43:13 -0400
+Subject: [PATCH] opkg-build: re-do find/ls code to not fail on filenames with
+ spaces
+
+Signed-off-by: Denys Dmytriyenko <denys@ti.com>
+---
+ opkg-build | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/opkg-build b/opkg-build
+index a9ccad2..07305b2 100755
+--- a/opkg-build
++++ b/opkg-build
+@@ -6,7 +6,6 @@
+ # 2003-04-25 rea@sr.unh.edu
+ # Updated to work on Familiar Pre0.7rc1, with busybox tar.
+ # Note it Requires: binutils-ar (since the busybox ar can't create)
+-# For UID debugging it needs a better "find".
+ set -e
+
+ version=1.0
+@@ -47,12 +46,12 @@ pkg_appears_sane() {
+
+ PKG_ERROR=0
+
+- tilde_files=`find . -name '*~'`
++ tilde_files=`find . -name '*~' -ls -printf '\\\n'`
+ if [ -n "$tilde_files" ]; then
+ if [ "$noclean" = "1" ]; then
+ echo "*** Warning: The following files have names ending in '~'.
+ You probably want to remove them: " >&2
+- ls -ld $tilde_files
++ echo -e $tilde_files
+ if [ $? -ne 0 ]; then
+ echo "*** Error: Fail to list files have names ending in '~'."
+ exit 1
+@@ -64,12 +63,12 @@ You probably want to remove them: " >&2
+ fi
+ fi
+
+- large_uid_files=`find . -uid +99 || true`
++ large_uid_files=`find . -uid +99 -ls -printf '\\\n' || true`
+
+ if [ "$ogargs" = "" ] && [ -n "$large_uid_files" ]; then
+ echo "*** Warning: The following files have a UID greater than 99.
+ You probably want to chown these to a system user: " >&2
+- ls -ld $large_uid_files
++ echo -e $large_uid_files
+ if [ $? -ne 0 ]; then
+ echo "*** Error: Fail to list files have a UID greater than 99."
+ exit 1
+--
+2.2.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch
new file mode 100644
index 000000000..6c66902ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch
@@ -0,0 +1,45 @@
+We have an issue when ls segfaults in some cases [1] so it's
+better to detect the failure at this level instead of continue
+the build process.
+
+[YOCTO #8926]
+
+Upstream-Status: Submitted [2]
+
+[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8926#c0
+[2] https://groups.google.com/forum/#!topic/opkg-devel/cmX02bgHZms
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ opkg-build | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/opkg-build b/opkg-build
+index 98008b6..a9ccad2 100755
+--- a/opkg-build
++++ b/opkg-build
+@@ -53,6 +53,10 @@ pkg_appears_sane() {
+ echo "*** Warning: The following files have names ending in '~'.
+ You probably want to remove them: " >&2
+ ls -ld $tilde_files
++ if [ $? -ne 0 ]; then
++ echo "*** Error: Fail to list files have names ending in '~'."
++ exit 1
++ fi
+ echo >&2
+ else
+ echo "*** Removing the following files: $tilde_files"
+@@ -66,6 +70,10 @@ You probably want to remove them: " >&2
+ echo "*** Warning: The following files have a UID greater than 99.
+ You probably want to chown these to a system user: " >&2
+ ls -ld $large_uid_files
++ if [ $? -ne 0 ]; then
++ echo "*** Error: Fail to list files have a UID greater than 99."
++ exit 1
++ fi
+ echo >&2
+ fi
+
+--
+2.1.4
+
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
new file mode 100644
index 000000000..4dddb08c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
@@ -0,0 +1,47 @@
+If a the number of hard links decreases or increases while creating
+the tar files used for an ipk package, tar fails with error code 1:
+
+| DEBUG: Executing python function do_package_ipk
+| tar: ./usr/src/debug/gperf/3.0.4-r0/gperf-3.0.4/src/main.cc: file changed as we read it
+NOTE: recipe gperf-3.0.4-r0: task do_package_write_ipk: Failed
+ERROR: Task 6539 (recipes-extended/gperf/gperf_3.0.4.bb, do_package_write_ipk) failed with exit code '1'
+
+
+We detect if the error code produced by tar is 1 and in this case ignore it.
+
+This a similar behavior to the one on dpkg:
+http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=40731942515ec8d80c727ad561174986d4f05818
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+
+Index: git/opkg-build
+===================================================================
+--- git.orig/opkg-build
++++ git/opkg-build
+@@ -250,8 +250,21 @@ tmp_dir=$dest_dir/IPKG_BUILD.$$
+ 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/$CONTROL && tar $ogargs -cz $tarformat -f $tmp_dir/control.tar.gz . )
++
++
++# Ignore error code 1, caused by modifying the number of hard links while creating the tar file
++rc=0
++( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -cz $tarformat -f $tmp_dir/data.tar.gz . ) || rc=$?
++if [ $rc -ne 1 ] && [ $rc -ne 0 ]; then
++ exit $rc
++fi
++
++rc=0
++( cd $pkg_dir/$CONTROL && tar $ogargs -cz $tarformat -f $tmp_dir/control.tar.gz . ) || rc=$?
++if [ $rc -ne 1 ] && [ $rc -ne 0 ]; then
++ exit $rc
++fi
++
+ rm $tmp_dir/tarX
+
+ echo "2.0" > $tmp_dir/debian-binary
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
new file mode 100644
index 000000000..8873b2870
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
@@ -0,0 +1,48 @@
+SUMMARY = "Additional utilities for the opkg package manager"
+SUMMARY_update-alternatives-opkg = "Utility for managing the alternatives system"
+SECTION = "base"
+HOMEPAGE = "http://code.google.com/p/opkg/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://opkg.py;beginline=1;endline=18;md5=15917491ad6bf7acc666ca5f7cc1e083"
+PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}"
+
+SRCREV = "53274f087565fd45d8452c5367997ba6a682a37a"
+PV = "0.1.8+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/opkg-utils \
+ file://opkg-build-Exit-when-fail-to-list-files.patch \
+ file://0001-opkg-build-re-do-find-ls-code-to-not-fail-on-filenam.patch"
+SRC_URI_append_class-native = " file://tar_ignore_error.patch"
+
+S = "${WORKDIR}/git"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+PYTHONRDEPS = "python python-shell python-io python-math python-crypt python-logging python-fcntl python-subprocess python-pickle python-compression python-textutils python-stringold"
+PYTHONRDEPS_class-native = ""
+
+PACKAGECONFIG = "python update-alternatives"
+PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
+PACKAGECONFIG[update-alternatives] = ",,,"
+
+do_install() {
+ oe_runmake PREFIX=${prefix} DESTDIR=${D} install
+ if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'true', 'false', d)}; then
+ rm -f "${D}${bindir}/update-alternatives"
+ fi
+}
+
+do_install_append_class-target() {
+ if [ -e "${D}${bindir}/update-alternatives" ]; then
+ sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${nonarch_libdir},g'
+ fi
+}
+
+PACKAGES =+ "update-alternatives-opkg"
+FILES_update-alternatives-opkg = "${bindir}/update-alternatives"
+RPROVIDES_update-alternatives-opkg = "update-alternatives update-alternatives-cworth"
+RREPLACES_update-alternatives-opkg = "update-alternatives-cworth"
+RCONFLICTS_update-alternatives-opkg = "update-alternatives-cworth"
+
+BBCLASSEXTEND = "native nativesdk"
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
new file mode 100644
index 000000000..ace3de4f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Architecture-dependent configuration for opkg"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+PR = "r1"
+
+S = "${WORKDIR}"
+
+do_compile() {
+ mkdir -p ${S}/${sysconfdir}/opkg/
+
+ archconf=${S}/${sysconfdir}/opkg/arch.conf
+
+ rm -f $archconf
+ ipkgarchs="${ALL_MULTILIB_PACKAGE_ARCHS}"
+ priority=1
+ for arch in $ipkgarchs; do
+ echo "arch $arch $priority" >> $archconf
+ priority=$(expr $priority + 5)
+ done
+}
+
+
+do_install () {
+ install -d ${D}${sysconfdir}/opkg
+ install -m 0644 ${S}/${sysconfdir}/opkg/* ${D}${sysconfdir}/opkg/
+}
+
+FILES_${PN} = "${sysconfdir}/opkg/ "
+
+CONFFILES_${PN} += "${sysconfdir}/opkg/arch.conf"
+
+RREPLACES_${PN} = "opkg-config-base"
+RCONFLICTS_${PN} = "opkg-config-base"
+RPROVIDES_${PN} = "opkg-config-base"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb
new file mode 100644
index 000000000..18d6abdde
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb
@@ -0,0 +1,48 @@
+SUMMARY = "Keyrings for verifying opkg packages and feeds"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+# Distro-specific keys can be added to this package in two ways:
+#
+# 1) In a .bbappend, add .gpg and/or .asc files to SRC_URI and install them to
+# ${D}${datadir}/opkg/keyrings/ in a do_install_append function. These
+# files should not be named 'key-$name.gpg' to ensure they don't conflict
+# with keys exported as per (2).
+#
+# 2) In a .bbappend, distro config or local.conf, override the variable
+# OPKG_KEYRING_KEYS to contain a space-separated list of key names. For
+# each name, 'gpg --export $name' will be ran to export the public key to a
+# file named 'key-$name.gpg'. The public key must therefore be in the gpg
+# keyrings on the build machine.
+
+OPKG_KEYRING_KEYS ?= ""
+
+do_compile() {
+ for name in ${OPKG_KEYRING_KEYS}; do
+ gpg --export ${name} > ${B}/key-${name}.gpg
+ done
+}
+
+do_install () {
+ install -d ${D}${datadir}/opkg/keyrings/
+ for name in ${OPKG_KEYRING_KEYS}; do
+ install -m 0644 ${B}/key-${name}.gpg ${D}${datadir}/opkg/keyrings/
+ done
+}
+
+FILES_${PN} = "${datadir}/opkg/keyrings"
+
+# We need 'opkg-key' to run the postinst script
+RDEPENDS_${PN} = "opkg"
+
+pkg_postinst_${PN} () {
+#! /bin/sh
+set -e
+
+if [ x"$D" = "x" ]; then
+ # On target
+ opkg-key populate
+else
+ exit 1
+fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-configure.ac-use-pkg-config-for-libsolv.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-configure.ac-use-pkg-config-for-libsolv.patch
new file mode 100644
index 000000000..e67ec7479
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-configure.ac-use-pkg-config-for-libsolv.patch
@@ -0,0 +1,36 @@
+From 2a43027f7ecf2bb3ce73f95bcf575c56bc495d07 Mon Sep 17 00:00:00 2001
+From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Date: Wed, 9 Dec 2015 17:38:05 -0600
+Subject: [PATCH] configure.ac: use pkg-config for libsolv
+
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+---
+ configure.ac | 12 +-----------
+ 1 file changed, 1 insertion(+), 11 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 52e1025..d17dc5c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -159,17 +159,7 @@ if test "x$want_solver" != "xno"; then
+ AC_MSG_ERROR(Specify which solver with --enable-solver=<SOLVER>)],
+ [libsolv],
+ [AC_MSG_RESULT(libsolv)
+-
+- SOLVER_CFLAGS="-I/usr/local/include/"
+- SOLVER_LIBS="-lsolv -lsolvext"
+- AC_CHECK_LIB([solv],
+- [solver_solve],
+- [],
+- [AC_MSG_ERROR(libsolv not found)])
+- dnl TODO: remove previous 6 lines and uncomment line below to use
+- dnl pkg-config once there is a release of libsolv with pkg-config:
+- dnl PKG_CHECK_MODULES(SOLVER, libsolv)
+-
++ PKG_CHECK_MODULES(SOLVER, libsolv)
+ AC_DEFINE(HAVE_SOLVER_LIBSOLV,1,[Define if you want to use libsolv])],
+ # default
+ [AC_MSG_RESULT(no)
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch
new file mode 100644
index 000000000..1ab1790d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch
@@ -0,0 +1,35 @@
+From 3e562bed7dced25eb3e9174ca9395324b6c873c1 Mon Sep 17 00:00:00 2001
+From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Date: Wed, 9 Dec 2015 13:36:14 -0600
+Subject: [PATCH] libsolv_solver_set_arch_policy: use correct logic during
+ archs resizing
+
+If there are more than INITIAL_ARCH_LIST_SIZE archs defined in the
+configuration, libsolv_solver_set_arch_policy crashes due to flawed
+logic when resizing the archs array.
+
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+---
+ libopkg/opkg_solver_libsolv.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/libopkg/opkg_solver_libsolv.c b/libopkg/opkg_solver_libsolv.c
+index 1cdcf1f..b5af0fa 100644
+--- a/libopkg/opkg_solver_libsolv.c
++++ b/libopkg/opkg_solver_libsolv.c
+@@ -66,8 +66,10 @@ static void libsolv_solver_set_arch_policy(libsolv_solver_t *libsolv_solver)
+ nv_pair_list_elt_t *arch_info;
+
+ list_for_each_entry(arch_info, &opkg_config->arch_list.head, node) {
+- if (arch_count > arch_list_size)
+- archs = xrealloc(archs, arch_list_size *= 2);
++ if (arch_count >= arch_list_size) {
++ arch_list_size *= 2;
++ archs = xrealloc(archs, arch_list_size * sizeof(arch_data_t));
++ }
+
+ archs[arch_count].arch = ((nv_pair_t *)(arch_info->data))->name;
+ archs[arch_count].priority = atoi(((nv_pair_t *)
+--
+1.9.1
+
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
new file mode 100644
index 000000000..255021b4b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch
@@ -0,0 +1,34 @@
+From a4628a6171f393add9a2b287483ca39bb72b4dd6 Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Mon, 21 Sep 2015 20:23:23 +1000
+Subject: [PATCH] opkg_conf: create opkg.lock in /run instead of /var/run
+
+This avoids a "Could not unlink" warning when extracting a /var/run
+symbolic link pointing to /run from a package as it is unable to
+unlink the /var/run directory when it contains opkg.lock.
+
+This also fixes an issue where /var/run is created as a directory
+instead of a symbolic link to /run.
+
+Upstream-Status: Inappropriate [OE-Specific]
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ libopkg/opkg_conf.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h
+index 7bca948..5a1bc44 100644
+--- 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_LOCK_FILE "/run/opkg.lock"
+
+ /* In case the config file defines no dest */
+ #define OPKG_CONF_DEFAULT_DEST_NAME "root"
+--
+2.5.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service
new file mode 100644
index 000000000..8e74026ec
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Opkg first boot configure
+DefaultDependencies=no
+After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
+Before=sysinit.target
+
+[Service]
+Type=oneshot
+EnvironmentFile=-@SYSCONFDIR@/default/postinst
+ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/opkg configure > $LOGFILE 2>&1; else @BINDIR@/opkg configure; fi"
+ExecStartPost=@BASE_BINDIR@/systemctl disable opkg-configure.service
+StandardOutput=syslog
+RemainAfterExit=No
+
+[Install]
+WantedBy=basic.target
+WantedBy=sysinit.target
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg.conf b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg.conf
new file mode 100644
index 000000000..c2e9e92f9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg/opkg.conf
@@ -0,0 +1,28 @@
+# Must have one or more source entries of the form:
+#
+# src <src-name> <source-url>
+#
+# and one or more destination entries of the form:
+#
+# dest <dest-name> <target-path>
+#
+# where <src-name> and <dest-names> are identifiers that
+# should match [a-zA-Z0-9._-]+, <source-url> should be a
+# URL that points to a directory containing a Familiar
+# Packages file, and <target-path> should be a directory
+# that exists on the target system.
+
+# Proxy Support
+#option http_proxy http://proxy.tld:3128
+#option ftp_proxy http://proxy.tld:3128
+#option proxy_username <username>
+#option proxy_password <password>
+
+# Enable GPGME signature
+# option check_signature 1
+
+# Offline mode (for use in constructing flash images offline)
+#option offline_root target
+
+# Default destination for installed packages
+dest root /
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.1.bb
new file mode 100644
index 000000000..577f49534
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/opkg/opkg_0.3.1.bb
@@ -0,0 +1,75 @@
+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://0001-libsolv_solver_set_arch_policy-use-correct-logic-dur.patch \
+ file://0001-configure.ac-use-pkg-config-for-libsolv.patch \
+"
+
+SRC_URI[md5sum] = "43735e5dc1ebf46bd6ce56a7cdfdc720"
+SRC_URI[sha256sum] = "d2c6c02a8384ec21168a1f0a186cb5e9f577d1452f491d02ed3e56b2ea8b87df"
+
+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] = "--enable-solver=libsolv,--disable-solver,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/orc/orc_0.4.24.bb b/import-layers/yocto-poky/meta/recipes-devtools/orc/orc_0.4.24.bb
new file mode 100644
index 000000000..520f88d92
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/orc/orc_0.4.24.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] = "9e793ec34c0e20339659dd4bbbf62135"
+SRC_URI[sha256sum] = "338cd493b5247300149821c6312bdf7422a3593ae98691fc75d7e4fe727bd39b"
+
+inherit autotools pkgconfig
+
+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/ossp-uuid/ossp-uuid/0001-Change-library-name.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0001-Change-library-name.patch
new file mode 100644
index 000000000..ed67c501c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0001-Change-library-name.patch
@@ -0,0 +1,119 @@
+From: Piotr Roszatycki <dexter@debian.org>
+Date: Wed, 27 Jan 2010 16:53:11 +0100
+Subject: [PATCH] Change library name
+
+The soname was changed to ossp-uuid to prevend the name clash with e2fsprogs's
+uuid library.
+---
+ Makefile.in | 6 +++---
+ perl/Makefile.PL | 12 ++++++------
+ php/config.m4 | 2 +-
+ uuid-config.in | 2 +-
+ uuid.pc.in | 4 ++--
+ 5 files changed, 13 insertions(+), 13 deletions(-)
+
+----
+Upstream-Status: Inappropriate [not author]
+
+This patch is from debian ossp-uuid 1.6.2 integration.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/Makefile.in b/Makefile.in
+index d28f4be..c2ba99d 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -62,13 +62,13 @@ PERL = @PERL@
+ PHP = @PHP@
+ PG_CONFIG = @PG_CONFIG@
+
+-LIB_NAME = libuuid.la
++LIB_NAME = libossp-uuid.la
+ LIB_OBJS = uuid.lo uuid_md5.lo uuid_sha1.lo uuid_prng.lo uuid_mac.lo uuid_time.lo uuid_ui64.lo uuid_ui128.lo uuid_str.lo
+
+-DCE_NAME = libuuid_dce.la
++DCE_NAME = libossp-uuid_dce.la
+ DCE_OBJS = uuid_dce.lo $(LIB_OBJS)
+
+-CXX_NAME = libuuid++.la
++CXX_NAME = libossp-uuid++.la
+ CXX_OBJS = uuid++.lo $(LIB_OBJS)
+
+ PRG_NAME = uuid
+diff --git a/perl/Makefile.PL b/perl/Makefile.PL
+index 92f4494..9c6fee6 100644
+--- a/perl/Makefile.PL
++++ b/perl/Makefile.PL
+@@ -33,9 +33,9 @@ use Config;
+ use ExtUtils::MakeMaker;
+
+ # determine source directory
+-my ($srcdir) = map { my $d = $_; $d =~ s/\/libuuid\.la$//; $d }
+- grep { -f $_ } ("../libuuid.la", glob("../*/libuuid.la"))
+- or die "no source directory found (where libuuid.la is located)";
++my ($srcdir) = map { my $d = $_; $d =~ s/\/libossp-uuid\.la$//; $d }
++ grep { -f $_ } ("../libossp-uuid.la", glob("../*/libossp-uuid.la"))
++ or die "no source directory found (where libossp-uuid.la is located)";
+
+ # determine extra build options
+ my $compat = 0;
+@@ -47,15 +47,15 @@ WriteMakefile(
+ VERSION_FROM => 'uuid.pm',
+ ABSTRACT_FROM => 'uuid.pod',
+ PREREQ_PM => {},
+- LIBS => [ "-L$srcdir/.libs -L$srcdir -luuid" ],
++ LIBS => [ "-L$srcdir/.libs -L$srcdir -lossp-uuid" ],
+ DEFINE => '',
+ INC => "-I. -I$srcdir",
+ PM => { 'uuid.pm' => '$(INST_LIBDIR)/uuid.pm',
+ 'uuid.pod' => '$(INST_LIBDIR)/uuid.pod',
+ ($compat ? ('uuid_compat.pm' => '$(INST_LIBDIR)/../Data/UUID.pm') : ()),
+ ($compat ? ('uuid_compat.pod' => '$(INST_LIBDIR)/../Data/UUID.pod') : ()), },
+- MAN3PODS => { 'uuid.pod' => '$(INST_MAN3DIR)/OSSP::uuid.3',
+- ($compat ? ('uuid_compat.pod' => '$(INST_MAN3DIR)/Data::UUID.3') : ()), },
++ MAN3PODS => { 'uuid.pod' => '$(INST_MAN3DIR)/OSSP::uuid.3pm',
++ ($compat ? ('uuid_compat.pod' => '$(INST_MAN3DIR)/Data::UUID.3pm') : ()), },
+ TYPEMAPS => [ 'uuid.tm' ],
+ test => { TESTS => 'uuid.ts' . ($compat ? ' uuid_compat.ts' : '') },
+ NO_META => 1,
+diff --git a/php/config.m4 b/php/config.m4
+index 5091b96..969b457 100644
+--- a/php/config.m4
++++ b/php/config.m4
+@@ -34,7 +34,7 @@ if test "$PHP_UUID" != "no"; then
+ PHP_NEW_EXTENSION(uuid, uuid.c, $ext_shared)
+ AC_DEFINE(HAVE_UUID, 1, [Have OSSP uuid library])
+ PHP_ADD_LIBPATH([..], )
+- PHP_ADD_LIBRARY([uuid],, UUID_SHARED_LIBADD)
++ PHP_ADD_LIBRARY([ossp-uuid],, UUID_SHARED_LIBADD)
+ PHP_ADD_INCLUDE([..])
+ PHP_SUBST(UUID_SHARED_LIBADD)
+
+diff --git a/uuid-config.in b/uuid-config.in
+index 8d2a063..5b58812 100644
+--- a/uuid-config.in
++++ b/uuid-config.in
+@@ -121,7 +121,7 @@ do
+ output_extra="$output_extra $uuid_ldflags"
+ ;;
+ --libs)
+- output="$output -luuid"
++ output="$output -lossp-uuid"
+ output_extra="$output_extra $uuid_libs"
+ ;;
+ * )
+diff --git a/uuid.pc.in b/uuid.pc.in
+index c76ad1e..de00c2f 100644
+--- a/uuid.pc.in
++++ b/uuid.pc.in
+@@ -36,7 +36,7 @@ Name: OSSP uuid
+ Description: Universally Unique Identifier (UUID) Library
+ Version: @UUID_VERSION_RAW@
+ URL: http://www.ossp.org/pkg/lib/uuid/
+-Cflags: -I${includedir}
+-Libs: -L${libdir} -luuid
++Cflags: -I${includedir}/ossp
++Libs: -L${libdir} -lossp-uuid
+ Libs.private: @LIBS@
+
+--
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch
new file mode 100644
index 000000000..804a62731
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch
@@ -0,0 +1,62 @@
+From: Marco Nenciarini <marco.nenciarini@devise.it>
+Date: Wed, 27 Jan 2010 19:46:21 +0100
+Subject: [PATCH] uuid: preserve -m option status in -v option handling
+
+Bug: 531396
+---
+ uuid_cli.c | 19 ++++++++++---------
+ 1 files changed, 10 insertions(+), 9 deletions(-)
+
+----
+Upstream-Status: Inappropriate [not author]
+
+This patch is from debian ossp-uuid 1.6.2 integration.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/uuid_cli.c b/uuid_cli.c
+index d1b0b11..14a67fe 100644
+--- a/uuid_cli.c
++++ b/uuid_cli.c
+@@ -140,11 +140,12 @@ int main(int argc, char *argv[])
+ i = strtol(optarg, &p, 10);
+ if (*p != '\0')
+ usage("invalid argument to option 'v'");
++ version &= ~(UUID_MAKE_V1|UUID_MAKE_V3|UUID_MAKE_V4|UUID_MAKE_V5);
+ switch (i) {
+- case 1: version = UUID_MAKE_V1; break;
+- case 3: version = UUID_MAKE_V3; break;
+- case 4: version = UUID_MAKE_V4; break;
+- case 5: version = UUID_MAKE_V5; break;
++ case 1: version |= UUID_MAKE_V1; break;
++ case 3: version |= UUID_MAKE_V3; break;
++ case 4: version |= UUID_MAKE_V4; break;
++ case 5: version |= UUID_MAKE_V5; break;
+ default:
+ usage("invalid version on option 'v'");
+ break;
+@@ -213,10 +214,10 @@ int main(int argc, char *argv[])
+ }
+ else {
+ /* encoding */
+- if ( (version == UUID_MAKE_V1 && argc != 0)
+- || (version == UUID_MAKE_V3 && argc != 2)
+- || (version == UUID_MAKE_V4 && argc != 0)
+- || (version == UUID_MAKE_V5 && argc != 2))
++ if ( (version & UUID_MAKE_V1 && argc != 0)
++ || (version & UUID_MAKE_V3 && argc != 2)
++ || (version & UUID_MAKE_V4 && argc != 0)
++ || (version & UUID_MAKE_V5 && argc != 2))
+ usage("invalid number of arguments");
+ if ((rc = uuid_create(&uuid)) != UUID_RC_OK)
+ error(1, "uuid_create: %s", uuid_error(rc));
+@@ -232,7 +233,7 @@ int main(int argc, char *argv[])
+ if ((rc = uuid_load(uuid, "nil")) != UUID_RC_OK)
+ error(1, "uuid_load: %s", uuid_error(rc));
+ }
+- if (version == UUID_MAKE_V3 || version == UUID_MAKE_V5) {
++ if (version & UUID_MAKE_V3 || version & UUID_MAKE_V5) {
+ if ((rc = uuid_create(&uuid_ns)) != UUID_RC_OK)
+ error(1, "uuid_create: %s", uuid_error(rc));
+ if ((rc = uuid_load(uuid_ns, argv[0])) != UUID_RC_OK) {
+--
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch
new file mode 100644
index 000000000..13cbb5989
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch
@@ -0,0 +1,58 @@
+From: Marco Nenciarini <marco.nenciarini@devise.it>
+Date: Tue, 2 Feb 2010 12:16:49 +0100
+Subject: [PATCH] Fix whatis entries
+
+Fix whatis entry of uuid.1, uuid.3ossp and uuid++.3ossp manpages
+---
+ uuid++.pod | 2 +-
+ uuid.pod | 2 +-
+ uuid_cli.pod | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+----
+Upstream-Status: Inappropriate [not author]
+
+This patch is from debian ossp-uuid 1.6.2 integration.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/uuid++.pod b/uuid++.pod
+index 8b5a4b1..89c5efb 100644
+--- a/uuid++.pod
++++ b/uuid++.pod
+@@ -31,7 +31,7 @@
+
+ =head1 NAME
+
+-B<OSSP uuid> - B<Universally Unique Identifier> (C++ API)
++B<uuid++> - B<Universally Unique Identifier> (C++ API)
+
+ =head1 VERSION
+
+diff --git a/uuid.pod b/uuid.pod
+index 4ad3742..0179a46 100644
+--- a/uuid.pod
++++ b/uuid.pod
+@@ -31,7 +31,7 @@
+
+ =head1 NAME
+
+-B<OSSP uuid> - B<Universally Unique Identifier>
++B<uuid> - B<Universally Unique Identifier>
+
+ =head1 VERSION
+
+diff --git a/uuid_cli.pod b/uuid_cli.pod
+index ddec6bb..df9dc83 100644
+--- a/uuid_cli.pod
++++ b/uuid_cli.pod
+@@ -31,7 +31,7 @@
+
+ =head1 NAME
+
+-B<OSSP uuid> - B<Universally Unique Identifier Command-Line Tool>
++B<uuid> - B<Universally Unique Identifier Command-Line Tool>
+
+ =head1 VERSION
+
+--
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0004-fix-data-uuid-from-string.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0004-fix-data-uuid-from-string.patch
new file mode 100644
index 000000000..bc5e111ee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0004-fix-data-uuid-from-string.patch
@@ -0,0 +1,43 @@
+Description: Support dash-less args to from_string.
+Author: Tim Retout <diocles@debian.org>
+Bug-Debian: http://bugs.debian.org/635607
+
+The module Data::GUID depends on Data::UUID supporting this behaviour.
+
+----
+Upstream-Status: Inappropriate [not author]
+
+This patch is from debian ossp-uuid 1.6.2 integration.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- a/perl/uuid_compat.pm
++++ b/perl/uuid_compat.pm
+@@ -93,7 +93,9 @@
+ $uuid->import('str',
+ $str =~ /^0x/
+ ? join '-', unpack('x2 a8 a4 a4 a4 a12', $str)
+- : $str
++ : $str =~ /-/
++ ? $str
++ : join '-', unpack('A8 A4 A4 A4 A12', $str)
+ );
+ return $uuid->export('bin');
+ }
+--- a/perl/uuid_compat.ts
++++ b/perl/uuid_compat.ts
+@@ -28,7 +28,7 @@
+ ## uuid_compat.ts: Data::UUID Backward Compatibility Perl API (Perl test suite part)
+ ##
+
+-use Test::More tests => 14;
++use Test::More tests => 16;
+
+ BEGIN {
+ use_ok('Data::UUID');
+@@ -53,3 +53,5 @@
+ ok($uuid8 = $ug->from_string("6ba7b811-9dad-11d1-80b4-00c04fd430c8"));
+ ok($ug->compare($uuid7, $uuid8) == 0);
+
++ok($uuid9 = $ug->from_string("6ba7b8119dad11d180b400c04fd430c8"));
++ok($ug->compare($uuid7, $uuid9) == 0);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch
new file mode 100644
index 000000000..04222cbf7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch
@@ -0,0 +1,19 @@
+uuid.pc is generated at build time so should be installed from the current
+directory, and not $S.
+
+Upstream-Status: Pending [should be submitted]
+Signed-Off-By: Ross Burton <ross.burton@intel.com>
+
+Index: uuid-1.6.2/Makefile.in
+===================================================================
+--- uuid-1.6.2.orig/Makefile.in 2012-11-13 16:58:28.624156000 +0000
++++ uuid-1.6.2/Makefile.in 2012-11-13 17:05:24.224158670 +0000
+@@ -232,7 +232,7 @@
+ $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1
+ $(SHTOOL) install -c -m 755 uuid-config $(DESTDIR)$(bindir)/
+ $(SHTOOL) install -c -m 644 $(S)/uuid-config.1 $(DESTDIR)$(mandir)/man1/
+- $(SHTOOL) install -c -m 644 $(S)/uuid.pc $(DESTDIR)$(libdir)/pkgconfig/
++ $(SHTOOL) install -c -m 644 uuid.pc $(DESTDIR)$(libdir)/pkgconfig/
+ $(SHTOOL) install -c -m 644 uuid.h $(DESTDIR)$(includedir)/
+ -@if [ ".$(WITH_DCE)" = .yes ]; then \
+ echo "$(SHTOOL) install -c -m 644 $(S)/uuid_dce.h $(DESTDIR)$(includedir)/"; \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch
new file mode 100644
index 000000000..4dfc1370c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch
@@ -0,0 +1,26 @@
+Obey LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Pending
+
+--- uuid-1.6.2.orig/Makefile.in
++++ uuid-1.6.2/Makefile.in
+@@ -113,15 +113,15 @@ all: $(TARGETS)
+ @$(LIBTOOL) --mode=compile $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $<
+
+ $(LIB_NAME): $(LIB_OBJS)
+- @$(LIBTOOL) --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \
++ @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \
+ -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h`
+
+ $(DCE_NAME): $(DCE_OBJS)
+- @$(LIBTOOL) --mode=link $(CC) -o $(DCE_NAME) $(DCE_OBJS) -rpath $(libdir) \
++ @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $(DCE_NAME) $(DCE_OBJS) -rpath $(libdir) \
+ -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h`
+
+ $(CXX_NAME): $(CXX_OBJS)
+- @$(LIBTOOL) --mode=link $(CXX) -o $(CXX_NAME) $(CXX_OBJS) -rpath $(libdir) \
++ @$(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $(CXX_NAME) $(CXX_OBJS) -rpath $(libdir) \
+ -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h`
+
+ $(PRG_NAME): $(PRG_OBJS) $(LIB_NAME)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch
new file mode 100644
index 000000000..4bc91b86e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch
@@ -0,0 +1,27 @@
+Remove hardcoded libtool name, fall back to generated name
+
+Upstream-Status: Inappropriate [no upstream]
+The project appears to no longer be accepting changes.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -ur uuid-1.6.2.orig/Makefile.in uuid-1.6.2/Makefile.in
+--- uuid-1.6.2.orig/Makefile.in 2012-05-14 14:37:19.579672930 -0500
++++ uuid-1.6.2/Makefile.in 2012-05-14 14:37:49.112733787 -0500
+@@ -32,6 +32,7 @@
+ VPATH = @srcdir@
+ srcdir = @srcdir@
+ top_srcdir = @top_srcdir@
++top_builddir = @top_builddir@
+ S = $(srcdir)
+ C = .
+
+@@ -55,7 +56,7 @@
+ CP = cp
+ RMDIR = rmdir
+ SHTOOL = $(S)/shtool
+-LIBTOOL = $(C)/libtool
++LIBTOOL = @LIBTOOL@
+ TRUE = true
+ POD2MAN = pod2man
+ PERL = @PERL@
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch
new file mode 100644
index 000000000..d806b5fb7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch
@@ -0,0 +1,19 @@
+We don't want anything stripped
+
+Upstream-Status: Inappropriate [no upstream]
+The project appears to no longer be accepting changes.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -ur uuid-1.6.2.orig/Makefile.in uuid-1.6.2/Makefile.in
+--- uuid-1.6.2.orig/Makefile.in 2012-05-14 14:42:42.225789456 -0500
++++ uuid-1.6.2/Makefile.in 2012-05-14 15:03:03.119733400 -0500
+@@ -254,7 +254,7 @@
+ -@if [ ".$(WITH_CXX)" = .yes ]; then \
+ $(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 $(CXX_NAME) $(DESTDIR)$(libdir)/; \
+ fi
+- @$(LIBTOOL) --mode=install $(SHTOOL) install -c -s -m 755 uuid $(DESTDIR)$(bindir)/
++ @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 755 uuid $(DESTDIR)$(bindir)/
+ $(SHTOOL) install -c -m 644 $(S)/uuid.1 $(DESTDIR)$(mandir)/man1/
+ -@if [ ".$(WITH_PERL)" = .yes ]; then \
+ (cd $(S)/perl && $(MAKE) $(MFLAGS) install DESTDIR=$(DESTDIR)); \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb
new file mode 100644
index 000000000..08926ba6b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb
@@ -0,0 +1,63 @@
+SUMMARY = "Universally Unique Identifier (UUID) library"
+DESCRIPTION = "OSSP uuid is a ISO-C:1999 application programming interface \
+(API) and corresponding command line interface (CLI) for the generation of \
+DCE 1.1, ISO/IEC 11578:1996 and RFC 4122 compliant Universally Unique \
+Identifier (UUID). It supports DCE 1.1 variant UUIDs of version 1 (time \
+and node based), version 3 (name based, MD5), version 4 (random number \
+based) and version 5 (name based, SHA-1)."
+DESCRIPTION_uuid = "This package contains a tool to create Universally \
+Unique Identifiers (UUID) from the command-line."
+
+HOMEPAGE = "http://www.ossp.org/pkg/lib/uuid/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://README;beginline=30;endline=55;md5=b394fadb039bbfca6ad9d9d769ee960e \
+ file://uuid_md5.c;beginline=1;endline=28;md5=9c1f4b2218546deae24c91be1dcf00dd"
+
+PR = "r2"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/o/${BPN}/${BPN}_${PV}.orig.tar.gz \
+ file://0001-Change-library-name.patch \
+ file://0002-uuid-preserve-m-option-status-in-v-option-handling.patch \
+ file://0003-Fix-whatis-entries.patch \
+ file://0004-fix-data-uuid-from-string.patch \
+ file://uuid-libtool.patch \
+ file://uuid-nostrip.patch \
+ file://install-pc.patch \
+ file://ldflags.patch \
+ "
+SRC_URI[md5sum] = "5db0d43a9022a6ebbbc25337ae28942f"
+SRC_URI[sha256sum] = "11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0"
+
+S = "${WORKDIR}/uuid-${PV}"
+
+inherit autotools update-alternatives
+
+EXTRA_OECONF = "--without-dce --without-cxx --without-perl --without-perl-compat --without-php --without-pgsql"
+EXTRA_OECONF = "--includedir=${includedir}/ossp"
+
+do_configure_prepend() {
+ # This package has a completely custom aclocal.m4, which should be acinclude.m4.
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ mv ${S}/aclocal.m4 ${S}/acinclude.m4
+ fi
+
+ rm -f ${S}/libtool.m4
+}
+
+do_install_append() {
+ mkdir -p ${D}${includedir}/ossp
+ mv ${D}${libdir}/pkgconfig/uuid.pc ${D}${libdir}/pkgconfig/ossp-uuid.pc
+}
+
+PACKAGES =+ "uuid"
+FILES_uuid = "${bindir}/uuid"
+FILES_${PN} = "${libdir}/libossp-uuid.so.16*"
+FILES_${PN}-dev += "${bindir}/uuid-config"
+
+BBCLASSEXTEND = "native nativesdk"
+
+ALTERNATIVE_${PN}-doc = "uuid.3"
+ALTERNATIVE_PRIORITY_${PN}-doc = "200"
+ALTERNATIVE_LINK_NAME[uuid.3] = "${mandir}/man3/uuid.3"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb b/import-layers/yocto-poky/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb
new file mode 100644
index 000000000..e83186005
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Provides a small set of tools for development on the device"
+LICENSE = "MIT"
+
+PR = "r1"
+
+inherit packagegroup
+
+RPROVIDES_${PN} = "qemu-config"
+RREPLACES_${PN} = "qemu-config"
+RCONFLICTS_${PN} = "qemu-config"
+
+RDEPENDS_${PN} = "\
+ distcc-config \
+ oprofileui-server \
+ nfs-export-root \
+ bash \
+ "
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch.inc b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch.inc
new file mode 100644
index 000000000..cbfb8cfcf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch.inc
@@ -0,0 +1,14 @@
+SUMMARY = "Tool for applying a patch file"
+DESCRIPTION = "patch takes a patch file containing a difference listing \
+produced by the diff program and applies those differences to one or more \
+original files, producing patched versions."
+SECTION = "utils"
+HOMEPAGE = "http://savannah.gnu.org/projects/patch/"
+
+SRC_URI = "${GNU_MIRROR}/patch/patch-${PV}.tar.gz"
+S = "${WORKDIR}/patch-${PV}"
+
+inherit autotools update-alternatives
+
+ALTERNATIVE_${PN} = "patch"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
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
new file mode 100644
index 000000000..1a0764659
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/debian.patch
@@ -0,0 +1,10426 @@
+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
new file mode 100644
index 000000000..bb7ca7912
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/global-reject-file.diff
@@ -0,0 +1,203 @@
+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
new file mode 100644
index 000000000..0354ec8f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/install.patch
@@ -0,0 +1,43 @@
+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
new file mode 100644
index 000000000..4b59212db
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch/unified-reject-files.diff
@@ -0,0 +1,307 @@
+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
new file mode 100644
index 000000000..c29b24075
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.5.9.bb
@@ -0,0 +1,12 @@
+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
new file mode 100644
index 000000000..f3fcf5e86
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patch/patch_2.7.5.bb
@@ -0,0 +1,15 @@
+require patch.inc
+LICENSE = "GPLv3"
+
+SRC_URI += "file://0001-Unset-need_charset_alias-when-building-for-musl.patch"
+
+SRC_URI[md5sum] = "ed4d5674ef4543b4eb463db168886dc7"
+SRC_URI[sha256sum] = "7436f5a19f93c3ca83153ce9c5cbe4847e97c5d956e57a220121e741f6e7968f"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+acpaths = "-I ${S}/m4 "
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}"
+PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf/maxsize.patch b/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf/maxsize.patch
new file mode 100644
index 000000000..cc04a89e6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf/maxsize.patch
@@ -0,0 +1,30 @@
+From f6886c2c33a1cf8771163919f3d20f6340c0ce38 Mon Sep 17 00:00:00 2001
+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
+Date: Fri, 10 Jul 2015 18:12:37 +0200
+Subject: [PATCH] Quick fix for #47
+
+https://github.com/NixOS/patchelf/issues/47
+
+Avoid issues with holes in binaries such as qemu-pcc from qemu-native.
+
+Upstream-Status: Submitted
+RP
+2016/2/3
+
+---
+ src/patchelf.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/patchelf.cc b/src/patchelf.cc
+index 8566ed9..df75593 100644
+--- a/src/patchelf.cc
++++ b/src/patchelf.cc
+@@ -248,7 +248,7 @@ static void readFile(string fileName, mode_t * fileMode)
+ if (stat(fileName.c_str(), &st) != 0) error("stat");
+ fileSize = st.st_size;
+ *fileMode = st.st_mode;
+- maxSize = fileSize + 8 * 1024 * 1024;
++ maxSize = fileSize + 64 * 1024 * 1024;
+
+ contents = (unsigned char *) malloc(fileSize + maxSize);
+ if (!contents) abort(); \ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf_0.8.bb b/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf_0.8.bb
new file mode 100644
index 000000000..8484a7e58
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/patchelf/patchelf_0.8.bb
@@ -0,0 +1,13 @@
+SRC_URI = "http://nixos.org/releases/${BPN}/${BPN}-${PV}/${BPN}-${PV}.tar.bz2 \
+ file://maxsize.patch"
+LICENSE = "GPLv3"
+SUMMARY = "Tool to allow editing of RPATH and interpreter fields in ELF binaries"
+
+SRC_URI[md5sum] = "5b151e3c83b31f5931b4a9fc01635bfd"
+SRC_URI[sha256sum] = "c99f84d124347340c36707089ec8f70530abd56e7827c54d506eb4cc097a17e7"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+inherit autotools
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.1.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.1.5.bb
new file mode 100644
index 000000000..a887c037d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pax-utils/pax-utils_1.1.5.bb
@@ -0,0 +1,35 @@
+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] = "bc3614322eaf88f167a608ae85d6b207"
+SRC_URI[sha256sum] = "2945b3e4df2e0dc95800bfbd3d88ab2243b2ee4ff064bbfc75734f6d9d986a89"
+
+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/perl/liberror-perl_0.17024.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/liberror-perl_0.17024.bb
new file mode 100644
index 000000000..6ae0e7e6f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/liberror-perl_0.17024.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Error - Error/exception handling in an OO-ish way"
+DESCRIPTION = "The Error package provides two interfaces. Firstly \
+Error provides a procedural interface to exception handling. \
+Secondly Error is a base class for errors/exceptions that can \
+either be thrown, for subsequent catch, or can simply be recorded."
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8f3499d09ee74a050c0319391ff9d100"
+
+DEPENDS += "perl"
+
+SRC_URI = "http://cpan.metacpan.org/authors/id/S/SH/SHLOMIF/Error-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "7e3676a7fb14f65f568f12d4b40a2a72"
+SRC_URI[sha256sum] = "074db7c783a67b0667eca64a4f6a0c3de94998afc92c01d6453163eb04b9150d"
+
+S = "${WORKDIR}/Error-${PV}"
+
+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.60.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/liburi-perl_1.60.bb
new file mode 100644
index 000000000..8809a44fc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/liburi-perl_1.60.bb
@@ -0,0 +1,29 @@
+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/libxml-parser-perl_2.44.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb
new file mode 100644
index 000000000..9561a5955
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb
@@ -0,0 +1,35 @@
+SUMMARY = "XML::Parser - A perl module for parsing XML documents"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://README;beginline=2;endline=6;md5=c8767d7516229f07b26e42d1cf8b51f1"
+
+DEPENDS += "expat expat-native"
+
+SRC_URI = "http://www.cpan.org/modules/by-module/XML/XML-Parser-${PV}.tar.gz"
+SRC_URI[md5sum] = "af4813fe3952362451201ced6fbce379"
+SRC_URI[sha256sum] = "1ae9d07ee9c35326b3d9aad56eae71a6730a73a116b9fe9e8a4758b7cc033216"
+
+S = "${WORKDIR}/XML-Parser-${PV}"
+
+EXTRA_CPANFLAGS = "EXPATLIBPATH=${STAGING_LIBDIR} EXPATINCPATH=${STAGING_INCDIR} CC='${CC}' LD='${CCLD}' FULL_AR='${AR}'"
+
+inherit cpan
+
+# fix up sub MakeMaker project as arguments don't get propagated though
+# see https://rt.cpan.org/Public/Bug/Display.html?id=28632
+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
+}
+
+do_compile() {
+ export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+ cpan_do_compile
+}
+
+do_compile_class-native() {
+ cpan_do_compile
+}
+
+BBCLASSEXTEND="native"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-perl_0.08.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-perl_0.08.bb
new file mode 100644
index 000000000..2c01976ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-perl_0.08.bb
@@ -0,0 +1,27 @@
+DESCRIPTION = "libxml-perl is a collection of smaller Perl modules, scripts, and \
+documents for working with XML in Perl. libxml-perl software \
+works in combination with XML::Parser, PerlSAX, XML::DOM, \
+XML::Grove and others."
+SUMMARY = "Collection of Perl modules for working with XML"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://README;beginline=33;endline=35;md5=1705549eef7577a3d6ba71123a1f0ce8"
+
+DEPENDS += "libxml-parser-perl"
+
+SRC_URI = "http://www.cpan.org/modules/by-module/XML/${BPN}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "0ed5fbdda53d1301ddaed88db10503bb"
+SRC_URI[sha256sum] = "4571059b7b5d48b7ce52b01389e95d798bf5cf2020523c153ff27b498153c9cb"
+
+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
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-simple-perl_2.22.bb b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-simple-perl_2.22.bb
new file mode 100644
index 000000000..2243bb2c2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/libxml-simple-perl_2.22.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Perl module for reading and writing XML"
+DESCRIPTION = "The XML::Simple Perl module provides a simple API layer \
+on top of an underlying XML parsing module to maintain XML files \
+(especially configuration files). It is a blunt rewrite of XML::Simple \
+(by Grant McLean) to use the XML::LibXML parser for XML structures, \
+where the original uses plain Perl or SAX parsers."
+HOMEPAGE = "http://search.cpan.org/~markov/XML-LibXML-Simple-0.93/lib/XML/LibXML/Simple.pod"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fa1187fceda00eee10b62961407ea7be"
+DEPENDS += "libxml-parser-perl"
+
+SRC_URI = "http://www.cpan.org/modules/by-module/XML/XML-Simple-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "0914abddfce749453ed89b54029f2643"
+SRC_URI[sha256sum] = "b9450ef22ea9644ae5d6ada086dc4300fa105be050a2030ebd4efd28c198eb49"
+
+S = "${WORKDIR}/XML-Simple-${PV}"
+
+EXTRA_PERLFLAGS = "-I ${PERLHOSTLIB}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
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
new file mode 100644
index 000000000..ed8222f24
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-native_5.22.1.bb
@@ -0,0 +1,127 @@
+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 \
+ "
+
+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-ptest.inc b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-ptest.inc
new file mode 100644
index 000000000..948ea7cdd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-ptest.inc
@@ -0,0 +1,37 @@
+inherit ptest
+
+SRC_URI += "file://run-ptest \
+ "
+
+do_install_ptest () {
+ mkdir -p ${D}${PTEST_PATH}
+ sed -e "s:\/opt:\/usr:" -i Porting/add-package.pl
+ sed -e "s:\/local\/gnu\/:\/:" -i hints/cxux.sh
+ tar -cf - * --exclude \*.o --exclude libperl.so --exclude Makefile --exclude makefile --exclude hostperl \
+ --exclude miniperl --exclude generate_uudmap --exclude patches | ( cd ${D}${PTEST_PATH} && tar -xf - )
+
+ 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" \
+ ${D}${PTEST_PATH}/lib/Config.pm
+
+ ln -sf ${bindir}/perl ${D}${PTEST_PATH}/t/perl
+
+}
+
+python populate_packages_prepend() {
+ # Put all *.t files from the lib dir in the ptest package
+ # do_split_packages requires a pair of () in the regex, but we have nothing
+ # to match, so use an empty pair.
+ if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
+ do_split_packages(d, d.expand('${libdir}/perl/${PV}'), '.*\.t()',
+ '${PN}-ptest%s', '%s', recursive=True, match_path=True)
+}
+
+RDEPENDS_${PN}-ptest += "${PN}-modules ${PN}-doc ${PN}-misc sed"
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
new file mode 100644
index 000000000..830ecce53
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl-rdepends_5.22.1.inc
@@ -0,0 +1,2562 @@
+# 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"
+DEPENDS_${PN}-module-math-bigint += "${PN}-module-math-bigint-calc"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-attributes"
+
+
+# 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.inc b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl.inc
new file mode 100644
index 000000000..3313a9436
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl.inc
@@ -0,0 +1,10 @@
+SUMMARY = "Perl scripting language"
+HOMEPAGE = "http://www.perl.org/"
+SECTION = "devel"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://Copying;md5=5b122a36d0f6dc55279a0ebc69f3c60b \
+ file://Artistic;md5=2e6fd2475335af892494fe1f7327baf3"
+
+SRC_URI = "http://www.cpan.org/src/5.0/${BP}.tar.xz"
+
+inherit upstream-version-is-even
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Configure-multilib.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Configure-multilib.patch
new file mode 100644
index 000000000..9625b0b84
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Configure-multilib.patch
@@ -0,0 +1,17 @@
+Upstream-Status:Pending
+
+Index: perl-5.12.3/Configure
+===================================================================
+--- perl-5.12.3.orig/Configure
++++ perl-5.12.3/Configure
+@@ -1316,8 +1316,9 @@ loclibpth="/usr/local/lib /opt/local/lib
+ loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
+
+ : general looking path for locating libraries
+-glibpth="/lib /usr/lib $xlibpth"
++glibpth="/lib /usr/lib /lib64 /usr/lib64 $xlibpth"
+ glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
++test -f /usr/lib/*-linux-gnu/libc.so && glibpth="/usr/lib/*-linux-gnu $glibpth"
+ test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
+ test -f /shlib/libc.so && glibpth="/shlib $glibpth"
+ test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch
new file mode 100644
index 000000000..eb92ccb67
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch
@@ -0,0 +1,22 @@
+Upstream-Status:Pending
+
+The perl-native should be relocatable while re-use sstate-cache from
+another build, especially the original build was renamed/removed.
+
+To get the MakeMaker.pm works in this case, we need perl wrapper here
+instead of real perl binary.
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+===================================================================
+--- perl-5.12.3/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm.orig 2011-08-12 16:07:30.000000000 +0800
++++ perl-5.12.3/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 2011-08-12 16:08:56.000000000 +0800
+@@ -1019,6 +1019,9 @@
+ }
+
+ foreach my $name (@$names){
++ # Getting MakeMaker.pm use perl wrapper instead of 'perl.real' directly
++ $name =~ s/perl\.real/perl/ if ($name =~ /perl\.real/);
++
+ foreach my $dir (@$dirs){
+ next unless defined $dir; # $self->{PERL_SRC} may be undefined
+ my ($abs, $val);
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
new file mode 100644
index 000000000..edf49d60e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch
@@ -0,0 +1,375 @@
+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
+ true)
+ # Prefix all runs of 'miniperl' and 'perl' with
+ # $ldlibpth so that ./perl finds *this* shared libperl.
+- case "$LD_LIBRARY_PATH" in
+- '') ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `" ;;
+- *) ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `:` quote "$LD_LIBRARY_PATH" `" ;;
+- esac
++ #case "$LD_LIBRARY_PATH" in
++ #'') ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `" ;;
++ #*) ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `:` quote "$LD_LIBRARY_PATH" `" ;;
++ #esac
+
+ pldlflags="$cccdlflags"
+ static_ldflags=''
+@@ -122,10 +122,11 @@ true)
+ *)
+ eval "ldlibpthval=\"\$$ldlibpthname\""
+
+- case "$ldlibpthval" in
+- '') ldlibpth="$ldlibpthname=` quote "$pwd" `" ;;
+- *) ldlibpth="$ldlibpthname=` quote "$pwd" `:` quote "$ldlibpthval" `" ;;
+- esac
++# We compile in the library path in OE from cross-compile, so lets not do this
++# case "$ldlibpthval" in
++# '') ldlibpth="$ldlibpthname=` quote "$pwd" `" ;;
++# *) ldlibpth="$ldlibpthname=` quote "$pwd" `:` quote "$ldlibpthval" `" ;;
++# esac
+
+ ;;
+ esac
+@@ -141,18 +142,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.
+- if test -f $archlib/CORE/$libperl; then
+- rm -f preload
+- cat <<'EOT' > preload
+-#! /bin/sh
+-lib=$1
+-shift
+-test -r $lib && export LD_PRELOAD="$lib $LD_PRELOAD"
+-exec "$@"
+-EOT
+- chmod 755 preload
+- ldlibpth="$ldlibpth `pwd`/preload `pwd`/$libperl"
+- fi
++ echo linux libraries overwritten by cross-compile patches
+ ;;
+ os390) test -f /bin/env && ldlibpth="/bin/env $ldlibpth"
+ ;;
+@@ -566,13 +556,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."
++
++all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) miniperl $(unidatafiles)
++
++more: $(generated_pods) $(private) $(public)
++
++more2: $(dynamic_ext)
++
++more3: $(nonxs_ext)
++
++more4: extras.make $(MANIFEST_SRT)
++
++$(MANIFEST_SRT): MANIFEST
++ @$(MINIPERL) Porting/manisort -q || (echo "WARNING: re-sorting MANIFEST"; \
++ $(MINIPERL) Porting/manisort -q -o MANIFEST; sh -c true)
+ @touch $(MANIFEST_SRT)
+
+ .PHONY: all utilities
+@@ -581,7 +581,7 @@ $(MANIFEST_SRT): MANIFEST $(PERL_EXE)
+ # by make_patchnum.pl.
+ git_version.h: lib/Config_git.pl
+
+-lib/Config_git.pl: $(MINIPERL_EXE) make_patchnum.pl
++lib/Config_git.pl: make_patchnum.pl
+ $(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
+ # loading, we need to build perl first.
+ case "$usedl$static_cwd" in
+ defineundef)
+- util_deps='$(MINIPERL_EXE) $(CONFIGPM) lib/auto/Cwd/Cwd$(DLSUFFIX) FORCE'
++ util_deps='$(CONFIGPM) lib/auto/Cwd/Cwd$(DLSUFFIX) FORCE'
+ ;;
+ definedefine)
+ util_deps='$(PERL_EXE) $(CONFIGPM) FORCE'
+@@ -604,7 +604,7 @@ definedefine)
+ esac
+
+ $spitshell >>$Makefile <<!GROK!THIS!
+-utils/Makefile: \$(MINIPERL_EXE) \$(CONFIGPM) utils/Makefile.PL
++utils/Makefile: \$(CONFIGPM) utils/Makefile.PL
+ \$(MINIPERL) -Ilib utils/Makefile.PL
+
+ utilities: utils/Makefile $util_deps
+@@ -699,7 +699,7 @@ esac
+
+
+ $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
+ ;;
+ esac
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+-perl.exp: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH)
++perl.exp: makedef.pl $(CONFIGPM) $(SYM) $(SYMH)
+ ./$(MINIPERLEXP) makedef.pl --sort-fold PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" > perl.exp
+
+ !NO!SUBS!
+@@ -769,7 +769,7 @@ os2)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ MINIPERLEXP = miniperl
+
+-perl5.def: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) miniperl.map
++perl5.def: makedef.pl $(CONFIGPM) $(SYM) $(SYMH) miniperl.map
+ ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) CC_FLAGS="$(OPTIMIZE)" > perl5.def
+
+ !NO!SUBS!
+@@ -829,7 +829,7 @@ $(LIBPERL): $& $(obj) $(DYNALOADER) $(LI
+ true)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ rm -f $@
+- $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs)
++ $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) -Wl,-soname,libperl.so.5
+ !NO!SUBS!
+ case "$osname" in
+ aix)
+@@ -877,7 +877,9 @@ $(MINIPERL_EXE): lib/buildcustomize.pl
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ lib/buildcustomize.pl: $& $(mini_obj)
+ $(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(mini_obj) $(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
++ #$(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'
+ $(MINIPERL) -f write_buildcustomize.pl
+ !NO!SUBS!
+ ;;
+@@ -885,7 +887,9 @@ lib/buildcustomize.pl: $& $(mini_obj)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ lib/buildcustomize.pl: $& $(mini_obj) write ldcustomize.pl
+ $(CC) -o $(MINIPERL_EXE) $(mini_obj 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'
++ 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
+ -@rm -f miniperl.xok
+ $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
+ $(mini_obj) $(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
++ #$(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'
+ $(MINIPERL) -f write_buildcustomize.pl
+ !NO!SUBS!
+ ;;
+@@ -918,7 +924,9 @@ lib/buildcustomize.pl: \$& \$(mini_obj)
+ -@rm -f miniperl.xok
+ -@rm \$(MINIPERL_EXE)
+ \$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE)
+- \$(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
++ #\$(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'
+ \$(MINIPERL) -f write_buildcustomize.pl 'osname' "$osname"
+ !GROK!THIS!
+ else
+@@ -927,7 +935,9 @@ lib/buildcustomize.pl: $& $(mini_obj) wr
+ -@rm -f miniperl.xok
+ $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+ $(mini_obj) $(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
++ #$(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'
+ $(MINIPERL) -f write_buildcustomize.pl
+ !NO!SUBS!
+ fi
+@@ -971,7 +981,7 @@ case "${osname}" in
+ catamount)
+ $spitshell >>$Makefile <<!GROK!THIS!
+ .PHONY: makeppport
+-makeppport: \$(MINIPERL_EXE) \$(CONFIGPM)
++makeppport: \$(CONFIGPM)
+ -@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
+ *)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ .PHONY: makeppport
+-makeppport: $(MINIPERL_EXE) $(CONFIGPM) $(nonxs_ext)
++makeppport: $(CONFIGPM) $(nonxs_ext)
+ $(MINIPERL) mkppport
+
+ !NO!SUBS!
+@@ -991,16 +1001,16 @@ esac
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+
+ .PHONY: preplibrary
+-preplibrary: $(MINIPERL_EXE) $(CONFIGPM) $(PREPLIBRARY_LIBPERL)
++preplibrary: $(CONFIGPM) $(PREPLIBRARY_LIBPERL)
+
+ $(CONFIGPM_FROM_CONFIG_SH): $(CONFIGPOD)
+
+-$(CONFIGPOD): config.sh $(MINIPERL_EXE) configpm Porting/Glossary lib/Config_git.pl
++$(CONFIGPOD): config.sh configpm Porting/Glossary lib/Config_git.pl
+ $(MINIPERL) configpm
+
+ unidatafiles $(unidatafiles) pod/perluniprops.pod: uni.data
+
+-uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
++uni.data: $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
+ $(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
+ # $(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.
+-pod/perltoc.pod: $(perltoc_pod_prereqs) $(PERL_EXE) $(ext) pod/buildtoc
+- $(RUN_PERL) -f pod/buildtoc -q
++pod/perltoc.pod: $(perltoc_pod_prereqs) $(ext) pod/buildtoc
++ $(MINIPERL) -f pod/buildtoc -q
+
+ pod/perlapi.pod: pod/perlintern.pod
+
+-pod/perlintern.pod: $(MINIPERL_EXE) autodoc.pl embed.fnc
++pod/perlintern.pod: autodoc.pl embed.fnc
+ $(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
+
+-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
+ $spitshell >>$Makefile <<EOT
+
+ install_$name install-$name: \$(INSTALL_DEPENDENCE) installperl all installman
+- \$(RUN_PERL) installperl --destdir=\$(DESTDIR) $flags \$(INSTALLFLAGS) \$(STRIPFLAGS)
+- \$(RUN_PERL) installman --destdir=\$(DESTDIR) $flags
++ ./hostperl -Ifake_config_library -Ilib -MConfig installperl --destdir=\$(DESTDIR) $flags \$(INSTALLFLAGS) \$(STRIPFLAGS)
+ EOT
+ fi
+
+@@ -1079,11 +1088,7 @@ done
+ if test "X$hostperl" != X; then
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ install.perl: $(INSTALL_DEPENDENCE) installperl
+- $(HOST_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
+- -@test ! -s extras.lst || $(MAKE) extras.install
+-
+-install.man: all installman
+- $(HOST_PERL) installman --destdir=$(DESTDIR) $(INSTALLFLAGS)
++ ./hostperl -Ifake_config_library -Ilib -MConfig installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
+
+ # 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
+ else
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ install.perl: $(INSTALL_DEPENDENCE) installperl
+- $(RUN_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
+- -@test ! -s extras.lst || PATH="`pwd`:\${PATH}" PERL5LIB="`pwd`/lib" \$(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
+-
+-install.man: all installman
+- $(RUN_PERL) installman --destdir=$(DESTDIR) $(INSTALLFLAGS)
++ ./hostperl -Ifake_config_library -Ilib -MConfig installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
+
+-# XXX Experimental. Hardwired values, but useful for testing.
+-# Eventually Configure could ask for some of these values.
+-install.html: all installhtml
+- -@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd ..
+- $(RUN_PERL) installhtml \
+- --podroot=. --podpath=. --recurse \
+- --htmldir=$(privlib)/html \
+- --htmlroot=$(privlib)/html \
+- --splithead=pod/perlipc \
+- --splititem=pod/perlfunc \
+- --ignore=Porting/Maintainers.pm,Porting/pumpkin.pod,Porting/repository.pod \
+- --verbose
+ !NO!SUBS!
+ fi
+
+@@ -1210,13 +1199,13 @@ manicheck: FORCE
+ #
+ # DynaLoader may be needed for extensions that use Makefile.PL.
+
+-$(DYNALOADER): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE $(nonxs_ext)
++$(DYNALOADER): lib/buildcustomize.pl preplibrary FORCE $(nonxs_ext)
+ $(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
+
+-d_dummy $(dynamic_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE $(PERLEXPORT) $(LIBPERL)
++d_dummy $(dynamic_ext): lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE $(PERLEXPORT) $(LIBPERL)
+ $(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
+
+-s_dummy $(static_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE
++s_dummy $(static_ext): lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE
+ $(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
+
+ case "$targethost" in
+ '') $spitshell >>$Makefile <<'!NO!SUBS!'
+-test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
++test_prep test-prep: test_prep_pre $(unidatafiles) $(PERL_EXE) \
+ $(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods)
+ cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
+
+ !NO!SUBS!
+ ;;
+ *) $spitshell >>$Makefile <<!GROK!THIS!
+-test_prep test-prep: test_prep_pre \$(MINIPERL_EXE) \$(unidatafiles) \$(PERL_EXE) \
++test_prep test-prep: test_prep_pre \$(unidatafiles) \$(PERL_EXE) \
+ \$(dynamic_ext) \$(TEST_PERL_DLL) runtests \
+ \$(generated_pods)
+ $to libperl.*
+@@ -1465,7 +1454,7 @@ test_prep test-prep: test_prep_pre \$(MI
+ esac
+
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+-test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
++test_prep_reonly: $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
+ $(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:
+
+ 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
+
+ minitest-notty minitest_notty: $(MINIPERL_EXE) minitest_prep
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.patch
new file mode 100644
index 000000000..858e2e10f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/Makefile.patch
@@ -0,0 +1,58 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.14.2/Cross/Makefile
+===================================================================
+--- perl-5.14.2.orig/Cross/Makefile
++++ perl-5.14.2/Cross/Makefile
+@@ -1,6 +1,7 @@
+ ## Toplevel Makefile for cross-compilation of perl
+
+-export TOPDIR=${shell pwd}
++override TOPDIR=${shell pwd}
++export TOPDIR
+ include $(TOPDIR)/config
+ export CFLAGS
+ export SYS=$(ARCH)-$(OS)
+@@ -10,7 +11,7 @@ export OPTIMIZATION = -O2
+
+ export CC = $(CROSS)gcc
+ export CXX = $(CROSS)g++
+-export LD = $(CROSS)ld
++export LD = $(CC)
+ export STRIP = $(CROSS)strip
+ export AR = $(CROSS)ar
+ export RANLIB = $(CROSS)ranlib
+@@ -32,17 +33,6 @@ CFLAGS+=$(FULL_OPTIMIZATION)
+ all:
+ @echo Please read the README file before doing anything else.
+
+-gen_patch:
+- diff -Bbur ../Makefile.SH Makefile.SH > Makefile.SH.patch
+- diff -Bbur ../installperl installperl > installperl.patch
+-
+-patch:
+- cd .. ; if [ ! -e ./CROSS_PATCHED ] ; then \
+- patch -p1 < Cross/Makefile.SH.patch; \
+- patch -p1 < Cross/installperl.patch ; mv installperl installperl-patched; \
+- sed -e 's/XXSTRIPXX/$(SYS)/' installperl-patched > installperl; \
+- touch CROSS_PATCHED ; fi
+-
+ perl:
+ @echo Perl cross-build directory is $(TOPDIR)
+ @echo Target arch is $(SYS)
+@@ -52,11 +42,11 @@ perl:
+ $(TOPDIR)/generate_config_sh config.sh-$(SYS) > $(TOPDIR)/../config.sh
+ cd $(TOPDIR)/.. ; ./Configure -S ; make depend ; make ; make more
+ cd $(TOPDIR)/.. ; mkdir -p fake_config_library ; cp lib/Config.pm lib/Config_heavy.pl fake_config_library
+- cd $(TOPDIR)/.. ; $(MAKE) more2 "PERLRUN=/usr/bin/perl -I$(TOPDIR)/../fake_config_library -MConfig"
+- cd $(TOPDIR)/.. ; $(MAKE) more3 "PERLRUN=/usr/bin/perl -I$(TOPDIR)/../fake_config_library -MConfig"
+- cd $(TOPDIR)/.. ; $(MAKE) more4 "PERLRUN=/usr/bin/perl -I$(TOPDIR)/../fake_config_library -MConfig"
++ cd $(TOPDIR)/.. ; $(MAKE) more2 "PERLRUN=hostperl -I$(TOPDIR)/../fake_config_library -MConfig"
++ cd $(TOPDIR)/.. ; $(MAKE) more3 "PERLRUN=hostperl -I$(TOPDIR)/../fake_config_library -MConfig"
++ cd $(TOPDIR)/.. ; $(MAKE) more4 "PERLRUN=hostperl -I$(TOPDIR)/../fake_config_library -MConfig"
+ cd $(TOPDIR)/.. ; rm -rf install_me_here
+- cd $(TOPDIR)/.. ; make install-strip
++# cd $(TOPDIR)/.. ; make install-strip
+ cd $(TOPDIR)/.. ; sh -x Cross/warp
+
+
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
new file mode 100644
index 000000000..59e016e4d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh
@@ -0,0 +1,1221 @@
+#!/bin/sh
+#
+# This file was produced by running the Configure script. It holds all the
+# definitions figured out by Configure. Should you modify one of these values,
+# do not forget to propagate your changes by running "Configure -der". You may
+# instead choose to run each of the .SH files by yourself, or "Configure -S".
+#
+
+# Package name : perl5
+# Source directory : .
+# Configuration time: Thu Jun 18 05:37:27 UTC 2015
+# Configured by : Open Embedded
+# Target system : linux qemux86-64 3.19.5-yocto-standard #1 smp preempt tue jun 16 00:28:17 pdt 2015 x86_64 gnulinux
+
+: 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_argc=28
+config_arg1='-des'
+config_arg2='-Doptimize=-O2'
+config_arg3='-Dmyhostname=localhost'
+config_arg4='-Dperladmin=root@localhost'
+config_arg5='-Dcc=gcc'
+config_arg6='-Dcf_by=Open Embedded'
+config_arg7='-Dinstallprefix=@EXECPREFIX@'
+config_arg8='-Dprefix=@EXECPREFIX@'
+config_arg9='-Dvendorprefix=@EXECPREFIX@'
+config_arg10='-Dsiteprefix=@EXECPREFIX@'
+config_arg11='-Dotherlibdirs=@LIBDIR@/perl/5.22.1'
+config_arg12='-Duseshrplib'
+config_arg13='-Dusethreads'
+config_arg14='-Duseithreads'
+config_arg15='-Duselargefiles'
+config_arg16='-Ud_dosuid'
+config_arg17='-Dd_semctl_semun'
+config_arg18='-Ui_db'
+config_arg19='-Ui_ndbm'
+config_arg20='-Ui_gdbm'
+config_arg21='-Di_shadow'
+config_arg22='-Di_syslog'
+config_arg23='-Dman3ext=3pm'
+config_arg24='-Duseperlio'
+config_arg25='-Dinstallusrbinperl'
+config_arg26='-Ubincompat5005'
+config_arg27='-Uversiononly'
+config_arg28='-Dpager=@USRBIN@/less -isr'
+
+Author=''
+Date=''
+Header=''
+Id=''
+Locker=''
+Log=''
+RCSfile=''
+Revision=''
+Source=''
+State=''
+_a='.a'
+_exe=''
+_o='.o'
+afs='false'
+afsroot='/afs'
+alignbytes='8'
+ansi2knr=''
+aphostname=''
+api_revision='5'
+api_subversion='0'
+api_version='22'
+api_versionstring='5.22.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'
+archname64=''
+archname='@ARCH@-thread-multi'
+archobjs=''
+asctime_r_proto='REENTRANT_PROTO_B_SB'
+awk='awk'
+baserev='5.0'
+bash=''
+bin='@USRBIN@'
+bin_ELF='define'
+binexp='@USRBIN@'
+bison='bison'
+byacc='byacc'
+c=''
+castflags='0'
+cat='cat'
+cc='gcc'
+cccdlflags='-fPIC'
+ccdlflags='-Wl,-E -Wl,-rpath,@LIBDIR@/perl/5.22.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'
+ccsymbols=''
+ccversion=''
+cf_by='Open Embedded'
+cf_email='Open Embedded@localhost.localdomain'
+cf_time='Thu Jun 18 05:37:27 UTC 2015'
+charbits='8'
+charsize='1'
+chgrp=''
+chmod='chmod'
+chown=''
+clocktype='clock_t'
+comm='comm'
+compress=''
+contains='grep'
+cp='cp'
+cpio=''
+cpp='cpp'
+cpp_stuff='42'
+cppccsymbols=''
+cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe'
+cpplast='-'
+cppminus='-'
+cpprun='gcc -E'
+cppstdin='gcc -E'
+crypt_r_proto='REENTRANT_PROTO_B_CCS'
+cryptlib=''
+csh='csh'
+ctermid_r_proto='0'
+ctime_r_proto='REENTRANT_PROTO_B_SB'
+d_Gconvert='gcvt((x),(n),(b))'
+d_PRIEUldbl='define'
+d_PRIFUldbl='define'
+d_PRIGUldbl='define'
+d_PRIXU64='define'
+d_PRId64='define'
+d_PRIeldbl='define'
+d_PRIfldbl='define'
+d_PRIgldbl='define'
+d_PRIi64='define'
+d_PRIo64='define'
+d_PRIu64='define'
+d_PRIx64='define'
+d_SCNfldbl='define'
+d__fwalk='undef'
+d_access='define'
+d_accessx='undef'
+d_acosh='define'
+d_aintl='undef'
+d_alarm='define'
+d_archlib='define'
+d_asctime64='undef'
+d_asctime_r='define'
+d_asinh='define'
+d_atanh='define'
+d_atolf='undef'
+d_atoll='define'
+d_attribute_deprecated='define'
+d_attribute_format='define'
+d_attribute_malloc='define'
+d_attribute_nonnull='define'
+d_attribute_noreturn='define'
+d_attribute_pure='define'
+d_attribute_unused='define'
+d_attribute_warn_unused_result='define'
+d_backtrace='define'
+d_bcmp='define'
+d_bcopy='define'
+d_bsd='undef'
+d_bsdgetpgrp='undef'
+d_bsdsetpgrp='undef'
+d_builtin_choose_expr='define'
+d_builtin_expect='define'
+d_bzero='define'
+d_c99_variadic_macros='define'
+d_casti32='define'
+d_castneg='define'
+d_cbrt='define'
+d_charvspr='undef'
+d_chown='define'
+d_chroot='define'
+d_chsize='undef'
+d_class='undef'
+d_clearenv='define'
+d_closedir='define'
+d_cmsghdr_s='define'
+d_const='define'
+d_copysign='define'
+d_copysignl='define'
+d_cplusplus='undef'
+d_crypt='define'
+d_crypt_r='define'
+d_csh='undef'
+d_ctermid='define'
+d_ctermid_r='undef'
+d_ctime64='undef'
+d_ctime_r='define'
+d_cuserid='define'
+d_dbl_dig='define'
+d_dbminitproto='define'
+d_difftime64='undef'
+d_difftime='define'
+d_dir_dd_fd='undef'
+d_dirfd='define'
+d_dirnamlen='undef'
+d_dladdr='define'
+d_dlerror='define'
+d_dlopen='define'
+d_dlsymun='undef'
+d_dosuid='undef'
+d_drand48_r='define'
+d_drand48proto='define'
+d_dup2='define'
+d_eaccess='define'
+d_endgrent='define'
+d_endgrent_r='undef'
+d_endhent='define'
+d_endhostent_r='undef'
+d_endnent='define'
+d_endnetent_r='undef'
+d_endpent='define'
+d_endprotoent_r='undef'
+d_endpwent='define'
+d_endpwent_r='undef'
+d_endsent='define'
+d_endservent_r='undef'
+d_eofnblk='define'
+d_erf='define'
+d_erfc='define'
+d_eunice='undef'
+d_exp2='define'
+d_expm1='define'
+d_faststdio='undef'
+d_fchdir='define'
+d_fchmod='define'
+d_fchown='define'
+d_fcntl='define'
+d_fcntl_can_lock='define'
+d_fd_macros='define'
+d_fd_set='define'
+d_fdim='define'
+d_fds_bits='define'
+d_fegetround='define'
+d_fgetpos='define'
+d_finite='define'
+d_finitel='define'
+d_flexfnam='define'
+d_flock='define'
+d_flockproto='define'
+d_fma='define'
+d_fmax='define'
+d_fmin='define'
+d_fork='define'
+d_fp_class='undef'
+d_fp_classify='undef'
+d_fp_classl='undef'
+d_fpathconf='define'
+d_fpclass='undef'
+d_fpclassify='define'
+d_fpclassl='undef'
+d_fpgetround='undef'
+d_fpos64_t='undef'
+d_frexpl='define'
+d_fs_data_s='undef'
+d_fseeko='define'
+d_fsetpos='define'
+d_fstatfs='define'
+d_fstatvfs='define'
+d_fsync='define'
+d_ftello='define'
+d_ftime='undef'
+d_futimes='define'
+d_gdbm_ndbm_h_uses_prototypes='undef'
+d_gdbmndbm_h_uses_prototypes='define'
+d_getaddrinfo='define'
+d_getcwd='define'
+d_getespwnam='undef'
+d_getfsstat='undef'
+d_getgrent='define'
+d_getgrent_r='define'
+d_getgrgid_r='define'
+d_getgrnam_r='define'
+d_getgrps='define'
+d_gethbyaddr='define'
+d_gethbyname='define'
+d_gethent='define'
+d_gethname='define'
+d_gethostbyaddr_r='define'
+d_gethostbyname_r='define'
+d_gethostent_r='define'
+d_gethostprotos='define'
+d_getitimer='define'
+d_getlogin='define'
+d_getlogin_r='define'
+d_getmnt='undef'
+d_getmntent='define'
+d_getnameinfo='define'
+d_getnbyaddr='define'
+d_getnbyname='define'
+d_getnent='define'
+d_getnetbyaddr_r='define'
+d_getnetbyname_r='define'
+d_getnetent_r='define'
+d_getnetprotos='define'
+d_getpagsz='define'
+d_getpbyname='define'
+d_getpbynumber='define'
+d_getpent='define'
+d_getpgid='define'
+d_getpgrp2='undef'
+d_getpgrp='define'
+d_getppid='define'
+d_getprior='define'
+d_getprotobyname_r='define'
+d_getprotobynumber_r='define'
+d_getprotoent_r='define'
+d_getprotoprotos='define'
+d_getprpwnam='undef'
+d_getpwent='define'
+d_getpwent_r='define'
+d_getpwnam_r='define'
+d_getpwuid_r='define'
+d_getsbyname='define'
+d_getsbyport='define'
+d_getsent='define'
+d_getservbyname_r='define'
+d_getservbyport_r='define'
+d_getservent_r='define'
+d_getservprotos='define'
+d_getspnam='define'
+d_getspnam_r='define'
+d_gettimeod='define'
+d_gmtime64='undef'
+d_gmtime_r='define'
+d_gnulibc='define'
+d_grpasswd='define'
+d_hasmntopt='define'
+d_htonl='define'
+d_hypot='define'
+d_ilogb='define'
+d_ilogbl='define'
+d_inc_version_list='undef'
+d_index='undef'
+d_inetaton='define'
+d_inetntop='define'
+d_inetpton='define'
+d_int64_t='define'
+d_ip_mreq='define'
+d_ip_mreq_source='define'
+d_ipv6_mreq='define'
+d_ipv6_mreq_source='undef'
+d_isascii='define'
+d_isblank='define'
+d_isfinite='define'
+d_isfinitel='undef'
+d_isinf='define'
+d_isinfl='define'
+d_isless='undef'
+d_isnan='define'
+d_isnanl='define'
+d_isnormal='define'
+d_j0='define'
+d_j0l='define'
+d_killpg='define'
+d_lc_monetary_2008='define'
+d_lchown='define'
+d_ldbl_dig='define'
+d_ldexpl='define'
+d_lgamma='define'
+d_lgamma_r='define'
+d_libm_lib_version='define'
+d_libname_unique='undef'
+d_link='define'
+d_llrint='define'
+d_llrintl='define'
+d_llround='define'
+d_llroundl='define'
+d_localtime64='undef'
+d_localtime_r='define'
+d_localtime_r_needs_tzset='define'
+d_locconv='define'
+d_lockf='define'
+d_log1p='define'
+d_log2='define'
+d_logb='define'
+d_longdbl='define'
+d_longlong='define'
+d_lrint='define'
+d_lrintl='define'
+d_lround='define'
+d_lroundl='define'
+d_lseekproto='define'
+d_lstat='define'
+d_madvise='define'
+d_malloc_good_size='undef'
+d_malloc_size='undef'
+d_mblen='define'
+d_mbstowcs='define'
+d_mbtowc='define'
+d_memchr='define'
+d_memcmp='define'
+d_memcpy='define'
+d_memmove='define'
+d_memset='define'
+d_mkdir='define'
+d_mkdtemp='define'
+d_mkfifo='define'
+d_mkstemp='define'
+d_mkstemps='define'
+d_mktime64='undef'
+d_mktime='define'
+d_mmap='define'
+d_modfl='define'
+d_modfl_pow32_bug='undef'
+d_modflproto='define'
+d_mprotect='define'
+d_msg='define'
+d_msg_ctrunc='define'
+d_msg_dontroute='define'
+d_msg_oob='define'
+d_msg_peek='define'
+d_msg_proxy='define'
+d_msgctl='define'
+d_msgget='define'
+d_msghdr_s='define'
+d_msgrcv='define'
+d_msgsnd='define'
+d_msync='define'
+d_munmap='define'
+d_mymalloc='undef'
+d_nan='define'
+d_ndbm='define'
+d_ndbm_h_uses_prototypes='undef'
+d_nearbyint='define'
+d_nextafter='define'
+d_nexttoward='define'
+d_nice='define'
+d_nl_langinfo='define'
+d_nv_preserves_uv='undef'
+d_nv_zero_is_allbits_zero='define'
+d_off64_t='define'
+d_old_pthread_create_joinable='undef'
+d_oldpthreads='undef'
+d_oldsock='undef'
+d_open3='define'
+d_pathconf='define'
+d_pause='define'
+d_perl_otherlibdirs='define'
+d_phostname='undef'
+d_pipe='define'
+d_poll='define'
+d_portable='define'
+d_prctl='define'
+d_prctl_set_name='define'
+d_printf_format_null='undef'
+d_procselfexe='define'
+d_pseudofork='undef'
+d_pthread_atfork='define'
+d_pthread_attr_setscope='define'
+d_pthread_yield='define'
+d_ptrdiff_t='define'
+d_pwage='undef'
+d_pwchange='undef'
+d_pwclass='undef'
+d_pwcomment='undef'
+d_pwexpire='undef'
+d_pwgecos='define'
+d_pwpasswd='define'
+d_pwquota='undef'
+d_qgcvt='define'
+d_quad='define'
+d_random_r='define'
+d_re_comp='undef'
+d_readdir64_r='define'
+d_readdir='define'
+d_readdir_r='define'
+d_readlink='define'
+d_readv='define'
+d_recvmsg='define'
+d_regcmp='undef'
+d_regcomp='define'
+d_remainder='define'
+d_remquo='define'
+d_rename='define'
+d_rewinddir='define'
+d_rint='define'
+d_rmdir='define'
+d_round='define'
+d_safebcpy='undef'
+d_safemcpy='undef'
+d_sanemcmp='define'
+d_sbrkproto='define'
+d_scalbn='define'
+d_scalbnl='define'
+d_sched_yield='define'
+d_scm_rights='define'
+d_seekdir='define'
+d_select='define'
+d_sem='define'
+d_semctl='define'
+d_semctl_semid_ds='define'
+d_semctl_semun='define'
+d_semget='define'
+d_semop='define'
+d_sendmsg='define'
+d_setegid='define'
+d_seteuid='define'
+d_setgrent='define'
+d_setgrent_r='undef'
+d_setgrps='define'
+d_sethent='define'
+d_sethostent_r='undef'
+d_setitimer='define'
+d_setlinebuf='define'
+d_setlocale='define'
+d_setlocale_r='undef'
+d_setnent='define'
+d_setnetent_r='undef'
+d_setpent='define'
+d_setpgid='define'
+d_setpgrp2='undef'
+d_setpgrp='define'
+d_setprior='define'
+d_setproctitle='undef'
+d_setprotoent_r='undef'
+d_setpwent='define'
+d_setpwent_r='undef'
+d_setregid='define'
+d_setresgid='define'
+d_setresuid='define'
+d_setreuid='define'
+d_setrgid='undef'
+d_setruid='undef'
+d_setsent='define'
+d_setservent_r='undef'
+d_setsid='define'
+d_setvbuf='define'
+d_shm='define'
+d_shmat='define'
+d_shmatprototype='define'
+d_shmctl='define'
+d_shmdt='define'
+d_shmget='define'
+d_sigaction='define'
+d_signbit='define'
+d_sigprocmask='define'
+d_sigsetjmp='define'
+d_sin6_scope_id='define'
+d_sitearch='define'
+d_snprintf='define'
+d_sockaddr_in6='define'
+d_sockaddr_sa_len='undef'
+d_sockatmark='define'
+d_sockatmarkproto='define'
+d_socket='define'
+d_socklen_t='define'
+d_sockpair='define'
+d_socks5_init='undef'
+d_sprintf_returns_strlen='define'
+d_sqrtl='define'
+d_srand48_r='define'
+d_srandom_r='define'
+d_sresgproto='define'
+d_sresuproto='define'
+d_stat='define'
+d_statblks='define'
+d_statfs_f_flags='define'
+d_statfs_s='define'
+d_static_inline='define'
+d_statvfs='define'
+d_stdio_cnt_lval='undef'
+d_stdio_ptr_lval='undef'
+d_stdio_ptr_lval_nochange_cnt='undef'
+d_stdio_ptr_lval_sets_cnt='undef'
+d_stdio_stream_array='undef'
+d_stdiobase='undef'
+d_stdstdio='undef'
+d_strchr='define'
+d_strcoll='define'
+d_strctcpy='define'
+d_strerrm='strerror(e)'
+d_strerror='define'
+d_strerror_r='define'
+d_strftime='define'
+d_strlcat='undef'
+d_strlcpy='undef'
+d_strtod='define'
+d_strtol='define'
+d_strtold='define'
+d_strtoll='define'
+d_strtoq='define'
+d_strtoul='define'
+d_strtoull='define'
+d_strtouq='define'
+d_strxfrm='define'
+d_suidsafe='undef'
+d_symlink='define'
+d_syscall='define'
+d_syscallproto='define'
+d_sysconf='define'
+d_sysernlst=''
+d_syserrlst='define'
+d_system='define'
+d_tcgetpgrp='define'
+d_tcsetpgrp='define'
+d_telldir='define'
+d_telldirproto='define'
+d_tgamma='define'
+d_time='define'
+d_timegm='define'
+d_times='define'
+d_tm_tm_gmtoff='define'
+d_tm_tm_zone='define'
+d_tmpnam_r='define'
+d_trunc='define'
+d_truncate='define'
+d_truncl='define'
+d_ttyname_r='define'
+d_tzname='define'
+d_u32align='define'
+d_ualarm='define'
+d_umask='define'
+d_uname='define'
+d_union_semun='undef'
+d_unordered='undef'
+d_unsetenv='define'
+d_usleep='define'
+d_usleepproto='define'
+d_ustat='define'
+d_vendorarch='define'
+d_vendorbin='define'
+d_vendorlib='define'
+d_vendorscript='define'
+d_vfork='undef'
+d_void_closedir='undef'
+d_voidsig='define'
+d_voidtty=''
+d_volatile='define'
+d_vprintf='define'
+d_vsnprintf='define'
+d_wait4='define'
+d_waitpid='define'
+d_wcscmp='define'
+d_wcstombs='define'
+d_wcsxfrm='define'
+d_wctomb='define'
+d_writev='define'
+d_xenix='undef'
+date='date'
+db_hashtype='u_int32_t'
+db_prefixtype='size_t'
+db_version_major=''
+db_version_minor=''
+db_version_patch=''
+direntrytype='struct dirent'
+dlext='so'
+dlsrc='dl_dlopen.xs'
+doublekind='3'
+doublesize='8'
+drand01='Perl_drand48()'
+drand48_r_proto='REENTRANT_PROTO_I_ST'
+dtrace=''
+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'
+echo='echo'
+egrep='egrep'
+emacs=''
+endgrent_r_proto='0'
+endhostent_r_proto='0'
+endnetent_r_proto='0'
+endprotoent_r_proto='0'
+endpwent_r_proto='0'
+endservent_r_proto='0'
+eunicefix=':'
+exe_ext=''
+expr='expr'
+extensions='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 Archive/Tar Attribute/Handlers AutoLoader B/Debug CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Carp Config/Perl/V Devel/SelfStubber Digest Dumpvalue Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS File/Fetch File/Find File/Path File/Temp FileCache Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata NEXT Net/Ping Params/Check Parse/CPAN/Meta Perl/OSType PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local Unicode/Normalize XSLoader autodie autouse base bignum constant encoding/warnings experimental if lib libnet parent perlfaq podlators version'
+extern_C='extern'
+extras=''
+fflushNULL='define'
+fflushall='undef'
+find=''
+firstmakefile='makefile'
+flex=''
+fpossize='16'
+fpostype='fpos_t'
+freetype='void'
+from=':'
+full_ar='ar'
+full_csh='csh'
+full_sed='sed'
+gccansipedantic=''
+gccosandvers=''
+gccversion='4.9.2'
+getgrent_r_proto='REENTRANT_PROTO_I_SBWR'
+getgrgid_r_proto='REENTRANT_PROTO_I_TSBWR'
+getgrnam_r_proto='REENTRANT_PROTO_I_CSBWR'
+gethostbyaddr_r_proto='REENTRANT_PROTO_I_TsISBWRE'
+gethostbyname_r_proto='REENTRANT_PROTO_I_CSBWRE'
+gethostent_r_proto='REENTRANT_PROTO_I_SBWRE'
+getlogin_r_proto='REENTRANT_PROTO_I_BW'
+getnetbyaddr_r_proto='REENTRANT_PROTO_I_uISBWRE'
+getnetbyname_r_proto='REENTRANT_PROTO_I_CSBWRE'
+getnetent_r_proto='REENTRANT_PROTO_I_SBWRE'
+getprotobyname_r_proto='REENTRANT_PROTO_I_CSBWR'
+getprotobynumber_r_proto='REENTRANT_PROTO_I_ISBWR'
+getprotoent_r_proto='REENTRANT_PROTO_I_SBWR'
+getpwent_r_proto='REENTRANT_PROTO_I_SBWR'
+getpwnam_r_proto='REENTRANT_PROTO_I_CSBWR'
+getpwuid_r_proto='REENTRANT_PROTO_I_TSBWR'
+getservbyname_r_proto='REENTRANT_PROTO_I_CCSBWR'
+getservbyport_r_proto='REENTRANT_PROTO_I_ICSBWR'
+getservent_r_proto='REENTRANT_PROTO_I_SBWR'
+getspnam_r_proto='REENTRANT_PROTO_I_CSBWR'
+gidformat='"u"'
+gidsign='1'
+gidsize='4'
+gidtype='gid_t'
+glibpth='@EXECPREFIX@/shlib @BASELIBDIR@ @LIBDIR@ @LIBDIR@/386 @BASELIBDIR@386 @EXECPREFIX@/ccs@BASELIBDIR@ @EXECPREFIX@/ucblib @EXECPREFIX@/local@BASELIBDIR@ @BASELIBDIR@ @LIBDIR@ @EXECPREFIX@/local@BASELIBDIR@ '
+gmake='gmake'
+gmtime_r_proto='REENTRANT_PROTO_S_TS'
+gnulibc_version='2.21'
+grep='grep'
+groupcat='cat /etc/group'
+groupstype='gid_t'
+gzip='gzip'
+h_fcntl='false'
+h_sysfile='true'
+hint='recommended'
+hostcat='cat /etc/hosts'
+hostgenerate=''
+hostosname=''
+hostperl=''
+html1dir=' '
+html1direxp=''
+html3dir=' '
+html3direxp=''
+i16size='2'
+i16type='short'
+i32size='4'
+i32type='int'
+i64size='8'
+i64type='long'
+i8size='1'
+i8type='signed char'
+i_arpainet='define'
+i_assert='define'
+i_bfd='define'
+i_bsdioctl=''
+i_crypt='define'
+i_db='undef'
+i_dbm='define'
+i_dirent='define'
+i_dlfcn='define'
+i_execinfo='define'
+i_fcntl='undef'
+i_fenv='define'
+i_float='define'
+i_fp='undef'
+i_fp_class='undef'
+i_gdbm='undef'
+i_gdbm_ndbm='undef'
+i_gdbmndbm='define'
+i_grp='define'
+i_ieeefp='undef'
+i_inttypes='define'
+i_langinfo='define'
+i_libutil='undef'
+i_limits='define'
+i_locale='define'
+i_machcthr='undef'
+i_malloc='define'
+i_mallocmalloc='undef'
+i_math='define'
+i_memory='undef'
+i_mntent='define'
+i_ndbm='undef'
+i_netdb='define'
+i_neterrno='undef'
+i_netinettcp='define'
+i_niin='define'
+i_poll='define'
+i_prot='undef'
+i_pthread='define'
+i_pwd='define'
+i_quadmath='undef'
+i_rpcsvcdbm='undef'
+i_sgtty='undef'
+i_shadow='define'
+i_socks='undef'
+i_stdarg='define'
+i_stdbool='define'
+i_stddef='define'
+i_stdint='define'
+i_stdlib='define'
+i_string='define'
+i_sunmath='undef'
+i_sysaccess='undef'
+i_sysdir='define'
+i_sysfile='define'
+i_sysfilio='undef'
+i_sysin='undef'
+i_sysioctl='define'
+i_syslog='define'
+i_sysmman='define'
+i_sysmode='undef'
+i_sysmount='define'
+i_sysndir='undef'
+i_sysparam='define'
+i_syspoll='define'
+i_sysresrc='define'
+i_syssecrt='undef'
+i_sysselct='define'
+i_syssockio='undef'
+i_sysstat='define'
+i_sysstatfs='define'
+i_sysstatvfs='define'
+i_systime='define'
+i_systimek='undef'
+i_systimes='define'
+i_systypes='define'
+i_sysuio='define'
+i_sysun='define'
+i_sysutsname='define'
+i_sysvfs='define'
+i_syswait='define'
+i_termio='undef'
+i_termios='define'
+i_time='define'
+i_unistd='define'
+i_ustat='define'
+i_utime='define'
+i_values='define'
+i_varargs='undef'
+i_varhdr='stdarg.h'
+i_vfork='undef'
+ignore_versioned_solibs='y'
+inc_version_list=' '
+inc_version_list_init='0'
+incpath=''
+inews=''
+initialinstalllocation='@USRBIN@'
+installarchlib='@LIBDIR@/perl/5.22.1/@ARCH@-thread-multi'
+installbin='@USRBIN@'
+installhtml1dir=''
+installhtml3dir=''
+installman1dir=''
+installman3dir=''
+installprefix='@EXECPREFIX@'
+installprefixexp='@EXECPREFIX@'
+installprivlib='@LIBDIR@/perl/5.22.1'
+installscript='@USRBIN@'
+installsitearch='@LIBDIR@/perl/site_perl/5.22.1/@ARCH@-thread-multi'
+installsitebin='@USRBIN@'
+installsitehtml1dir=''
+installsitehtml3dir=''
+installsitelib='@LIBDIR@/perl/site_perl/5.22.1'
+installsiteman1dir=''
+installsiteman3dir=''
+installsitescript='@USRBIN@'
+installstyle='lib/perl'
+installusrbinperl='define'
+installvendorarch='@LIBDIR@/perl/vendor_perl/5.22.1/@ARCH@-thread-multi'
+installvendorbin='@USRBIN@'
+installvendorhtml1dir=''
+installvendorhtml3dir=''
+installvendorlib='@LIBDIR@/perl/vendor_perl/5.22.1'
+installvendorman1dir=''
+installvendorman3dir=''
+installvendorscript='@USRBIN@'
+intsize='4'
+issymlink='test -h'
+ivdformat='"ld"'
+ivsize='8'
+ivtype='long'
+known_extensions='Archive/Tar Attribute/Handlers AutoLoader B B/Debug CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Carp Compress/Raw/Bzip2 Compress/Raw/Zlib Config/Perl/V Cwd DB_File Data/Dumper Devel/PPPort Devel/Peek Devel/SelfStubber Digest Digest/MD5 Digest/SHA Dumpvalue Encode Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS Fcntl File/DosGlob File/Fetch File/Find File/Glob File/Path File/Temp FileCache Filter/Simple Filter/Util/Call GDBM_File Getopt/Long HTTP/Tiny Hash/Util Hash/Util/FieldHash I18N/Collate I18N/LangTags I18N/Langinfo IO IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 IPC/SysV JSON/PP List/Util Locale/Codes Locale/Maketext Locale/Maketext/Simple MIME/Base64 Math/BigInt Math/BigInt/FastCalc Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata NDBM_File NEXT Net/Ping ODBM_File Opcode POSIX Params/Check Parse/CPAN/Meta Perl/OSType PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage SDBM_File Safe Search/Dict SelfLoader Socket Storable Sys/Hostname Sys/Syslog Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Hash/NamedCapture Tie/Memoize Tie/RefHash Time/HiRes Time/Local Time/Piece Unicode/Collate Unicode/Normalize VMS/DCLsym VMS/Filespec VMS/Stdio Win32 Win32API/File Win32CORE XS/APItest XS/Typemap XSLoader arybase attributes autodie autouse base bignum constant encoding/warnings experimental if lib libnet mro parent perlfaq podlators re threads threads/shared version '
+ksh=''
+ld='gcc'
+ld_can_script='define'
+lddlflags='-shared -O2'
+ldflags=''
+ldflags_uselargefiles=''
+ldlibpthname='LD_LIBRARY_PATH'
+less='less'
+lib_ext='.a'
+libc='libc-2.21.so'
+libperl='libperl.so'
+libpth='@LIBDIR@ @BASELIBDIR@'
+libs='-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat'
+libsdirs=' @LIBDIR@'
+libsfiles=' libpthread.so libnsl.so libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so'
+libsfound=' @LIBDIR@/libpthread.so @LIBDIR@/libnsl.so @LIBDIR@/libgdbm.so @LIBDIR@/libdb.so @LIBDIR@/libdl.so @LIBDIR@/libm.so @LIBDIR@/libcrypt.so @LIBDIR@/libutil.so @LIBDIR@/libc.so @LIBDIR@/libgdbm_compat.so'
+libspath=' @LIBDIR@ @BASELIBDIR@'
+libswanted='cl pthread socket inet nsl nm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat'
+libswanted_uselargefiles=''
+line=''
+lint=''
+lkflags=''
+ln='ln'
+lns='/bin/ln -s'
+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@'
+longdblkind='3'
+longdblsize='16'
+longlongsize='8'
+longsize='8'
+lp=''
+lpr=''
+ls='ls'
+lseeksize='8'
+lseektype='off_t'
+mail=''
+mailx=''
+make='make'
+make_set_make='#'
+mallocobj=''
+mallocsrc=''
+malloctype='void *'
+man1dir=' '
+man1direxp=''
+man1ext='0'
+man3dir=' '
+man3direxp=''
+man3ext='0'
+mips_type=''
+mistrustnm=''
+mkdir='mkdir'
+mmaptype='void *'
+modetype='mode_t'
+more='more'
+multiarch='undef'
+mv=''
+myarchname='@ARCH@'
+mydomain='.localdomain'
+myhostname='localhost'
+myuname='linux qemux86-64 3.19.5-yocto-standard #1 smp preempt tue jun 16 00:28:17 pdt 2015 x86_64 gnulinux '
+n='-n'
+need_va_copy='define'
+netdb_hlen_type='size_t'
+netdb_host_type='char *'
+netdb_name_type='const char *'
+netdb_net_type='in_addr_t'
+nm='nm'
+nm_opt=''
+nm_so_opt='--dynamic'
+nonxs_ext='Archive/Tar Attribute/Handlers AutoLoader B/Debug CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Carp Config/Perl/V Devel/SelfStubber Digest Dumpvalue Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS File/Fetch File/Find File/Path File/Temp FileCache Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata NEXT Net/Ping Params/Check Parse/CPAN/Meta Perl/OSType PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local Unicode/Normalize XSLoader autodie autouse base bignum constant encoding/warnings experimental if lib libnet parent perlfaq podlators version'
+nroff='nroff'
+nvEUformat='"E"'
+nvFUformat='"F"'
+nvGUformat='"G"'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
+nv_preserves_uv_bits='53'
+nveformat='"e"'
+nvfformat='"f"'
+nvgformat='"g"'
+nvsize='8'
+nvtype='double'
+o_nonblock='O_NONBLOCK'
+obj_ext='.o'
+old_pthread_create_joinable=''
+optimize='-O2'
+orderlib='false'
+osname='linux'
+osvers='3.19.5-yocto-standard'
+otherlibdirs='@LIBDIR@/perl/5.22.1'
+package='perl'
+pager='/usr/bin/less -isr'
+passcat='cat /etc/passwd'
+patchlevel='22'
+path_sep=':'
+perl5='@USRBIN@/perl'
+perl='perl'
+perl_patchlevel=''
+perl_static_inline='static __inline__'
+perladmin='root@localhost'
+perllibs='-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc'
+perlpath='@USRBIN@/perl'
+pg='pg'
+phostname=''
+pidtype='pid_t'
+plibpth='@LIBDIR@ @BASELIBDIR@'
+pmake=''
+pr=''
+prefix='@EXECPREFIX@'
+prefixexp='@EXECPREFIX@'
+privlib='@LIBDIR@/perl/5.22.1'
+privlibexp='@LIBDIR@/perl/5.22.1'
+procselfexe='"/proc/self/exe"'
+prototype='define'
+ptrsize='8'
+quadkind='2'
+quadtype='long'
+randbits='48'
+randfunc='Perl_drand48'
+random_r_proto='REENTRANT_PROTO_I_St'
+randseedtype='U32'
+ranlib=':'
+rd_nodata='-1'
+readdir64_r_proto='REENTRANT_PROTO_I_TSR'
+readdir_r_proto='REENTRANT_PROTO_I_TSR'
+revision='5'
+rm='rm'
+rm_try='/bin/rm -f try try a.out .out try.[cho] try..o core core.try* try.core*'
+rmail=''
+run=''
+runnm='false'
+sGMTIME_max='67768036191676799'
+sGMTIME_min='-62167219200'
+sLOCALTIME_max='67768036191676799'
+sLOCALTIME_min='-62167219200'
+sPRIEUldbl='"LE"'
+sPRIFUldbl='"LF"'
+sPRIGUldbl='"LG"'
+sPRIXU64='"lX"'
+sPRId64='"ld"'
+sPRIeldbl='"Le"'
+sPRIfldbl='"Lf"'
+sPRIgldbl='"Lg"'
+sPRIi64='"li"'
+sPRIo64='"lo"'
+sPRIu64='"lu"'
+sPRIx64='"lx"'
+sSCNfldbl='"Lf"'
+sched_yield='sched_yield()'
+scriptdir='@USRBIN@'
+scriptdirexp='@USRBIN@'
+sed='sed'
+seedfunc='Perl_drand48_init'
+selectminbits='64'
+selecttype='fd_set *'
+sendmail=''
+setgrent_r_proto='0'
+sethostent_r_proto='0'
+setlocale_r_proto='0'
+setnetent_r_proto='0'
+setprotoent_r_proto='0'
+setpwent_r_proto='0'
+setservent_r_proto='0'
+sh='/bin/sh'
+shar=''
+sharpbang='#!'
+shmattype='void *'
+shortsize='2'
+shrpenv=''
+shsharp='true'
+sig_count='65'
+sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS NUM32 NUM33 RTMIN NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 NUM63 RTMAX IOT CLD POLL UNUSED '
+sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "NUM32", "NUM33", "RTMIN", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "NUM63", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0'
+sig_num='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 '
+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'
+sitebin='@USRBIN@'
+sitebinexp='@USRBIN@'
+sitehtml1dir=''
+sitehtml1direxp=''
+sitehtml3dir=''
+sitehtml3direxp=''
+sitelib='@LIBDIR@/perl/site_perl/5.22.1'
+sitelib_stem='@LIBDIR@/perl/site_perl'
+sitelibexp='@LIBDIR@/perl/site_perl/5.22.1'
+siteman1dir=''
+siteman1direxp=''
+siteman3dir=''
+siteman3direxp=''
+siteprefix='@EXECPREFIX@'
+siteprefixexp='@EXECPREFIX@'
+sitescript='@USRBIN@'
+sitescriptexp='@USRBIN@'
+sizesize='8'
+sizetype='size_t'
+sleep=''
+smail=''
+so='so'
+sockethdr=''
+socketlib=''
+socksizetype='socklen_t'
+sort='sort'
+spackage='Perl5'
+spitshell='cat'
+srand48_r_proto='REENTRANT_PROTO_I_LS'
+srandom_r_proto='REENTRANT_PROTO_I_TS'
+src='.'
+ssizetype='ssize_t'
+st_ino_sign='1'
+st_ino_size='8'
+startperl='#!@USRBIN@/perl'
+startsh='#!/bin/sh'
+static_ext=' '
+stdchar='char'
+stdio_base='((fp)->_IO_read_base)'
+stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)'
+stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
+stdio_filbuf=''
+stdio_ptr='((fp)->_IO_read_ptr)'
+stdio_stream_array=''
+strerror_r_proto='REENTRANT_PROTO_B_IBW'
+strings='@INCLUDEDIR@/string.h'
+submit=''
+subversion='0'
+sysman='@EXECPREFIX@/share/man/man1'
+sysroot=''
+tail=''
+tar=''
+targetarch=''
+targetdir=''
+targetenv=''
+targethost=''
+targetmkdir=''
+targetport=''
+targetsh='/bin/sh'
+tbl=''
+tee=''
+test='test'
+timeincl='@INCLUDEDIR@/sys/time.h @INCLUDEDIR@/time.h '
+timetype='time_t'
+tmpnam_r_proto='REENTRANT_PROTO_B_B'
+to=':'
+touch='touch'
+tr='tr'
+trnl='\n'
+troff=''
+ttyname_r_proto='REENTRANT_PROTO_I_IBW'
+u16size='2'
+u16type='unsigned short'
+u32size='4'
+u32type='unsigned int'
+u64size='8'
+u64type='unsigned long'
+u8size='1'
+u8type='unsigned char'
+uidformat='"u"'
+uidsign='1'
+uidsize='4'
+uidtype='uid_t'
+uname='uname'
+uniq='uniq'
+uquadtype='unsigned long'
+use5005threads='undef'
+use64bitall='define'
+use64bitint='define'
+usecbacktrace='undef'
+usecrosscompile='define'
+usedevel='undef'
+usedl='define'
+usedtrace='undef'
+usefaststdio='undef'
+useithreads='define'
+usekernprocpathname='undef'
+uselargefiles='define'
+uselongdouble='undef'
+usemallocwrap='define'
+usemorebits='undef'
+usemultiplicity='define'
+usemymalloc='n'
+usenm='false'
+usensgetexecutablepath='undef'
+useopcode='true'
+useperlio='define'
+useposix='true'
+usequadmath='undef'
+usereentrant='undef'
+userelocatableinc='undef'
+useshrplib='true'
+usesitecustomize='undef'
+usesocks='undef'
+usethreads='define'
+usevendorprefix='define'
+useversionedarchname='undef'
+usevfork='false'
+usrinc='@INCLUDEDIR@'
+uuname=''
+uvXUformat='"lX"'
+uvoformat='"lo"'
+uvsize='8'
+uvtype='unsigned long'
+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'
+vendorbin='@USRBIN@'
+vendorbinexp='@USRBIN@'
+vendorhtml1dir=' '
+vendorhtml1direxp=''
+vendorhtml3dir=' '
+vendorhtml3direxp=''
+vendorlib='@LIBDIR@/perl/vendor_perl/5.22.1'
+vendorlib_stem='@LIBDIR@/perl/vendor_perl'
+vendorlibexp='@LIBDIR@/perl/vendor_perl/5.22.1'
+vendorman1dir=' '
+vendorman1direxp=''
+vendorman3dir=' '
+vendorman3direxp=''
+vendorprefix='@EXECPREFIX@'
+vendorprefixexp='@EXECPREFIX@'
+vendorscript='@USRBIN@'
+vendorscriptexp='@USRBIN@'
+version='5.22.1'
+version_patchlevel_string='version 22 subversion 0'
+versiononly='undef'
+vi=''
+xlibpth='@LIBDIR@/386 @BASELIBDIR@386'
+yacc='yacc'
+yaccflags=''
+zcat=''
+zip='zip'
+PERL_REVISION=5
+PERL_VERSION=22
+PERL_SUBVERSION=0
+PERL_API_REVISION=5
+PERL_API_VERSION=22
+PERL_API_SUBVERSION=0
+PERL_PATCHLEVEL=''
+PERL_CONFIG_SH=true
+: Variables propagated from previous config.sh file.
+libdb_needs_pthread='N'
+
+# for Time-HiRes
+d_clock_nanosleep='define'
+d_clock_gettime='define'
+d_clock_getres='define'
+d_clock='define'
+d_nanosleep='define'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32 b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32
new file mode 100644
index 000000000..7259a0c6a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32
@@ -0,0 +1,38 @@
+alignbytes='4'
+cf_time='Thu Dec 23 03:57:51 UTC 2010'
+cppsymbols='_FILE_OFFSET_BITS=64 _GNU_SOURCE=1 _LARGEFILE64_SOURCE=1 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=200809L _POSIX_SOURCE=1 _REENTRANT=1 _XOPEN_SOURCE=700 _XOPEN_SOURCE_EXTENDED=1 __BIGGEST_ALIGNMENT__=16 __CHAR16_TYPE__=short\ unsigned\ int __CHAR32_TYPE__=unsigned\ int __CHAR_BIT__=8 __DBL_DENORM_MIN__=((double)4.94065645841246544177e-324L) __DBL_DIG__=15 __DBL_EPSILON__=((double)2.22044604925031308085e-16L) __DBL_HAS_DENORM__=1 __DBL_HAS_INFINITY__=1 __DBL_HAS_QUIET_NAN__=1 __DBL_MANT_DIG__=53 __DBL_MAX_10_EXP__=308 __DBL_MAX_EXP__=1024 __DBL_MAX__=((double)1.79769313486231570815e+308L) __DBL_MIN_10_EXP__=(-307) __DBL_MIN_EXP__=(-1021) __DBL_MIN__=((double)2.22507385850720138309e-308L) __DEC128_EPSILON__=1E-33DL __DEC128_MANT_DIG__=34 __DEC128_MAX_EXP__=6145 __DEC128_MAX__=9.999999999999999999999999999999999E6144DL __DEC128_MIN_EXP__=(-6142) __DEC128_MIN__=1E-6143DL __DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL __DEC32_EPSILON__=1E-6DF __DEC32_MANT_DIG__=7 __DEC32_MAX_EXP__=97 __DEC32_MAX__=9.999999E96DF __DEC32_MIN_EXP__=(-94) __DEC32_MIN__=1E-95DF __DEC32_SUBNORMAL_MIN__=0.000001E-95DF __DEC64_EPSILON__=1E-15DD __DEC64_MANT_DIG__=16 __DEC64_MAX_EXP__=385 __DEC64_MAX__=9.999999999999999E384DD __DEC64_MIN_EXP__=(-382) __DEC64_MIN__=1E-383DD __DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD __DECIMAL_BID_FORMAT__=1 __DECIMAL_DIG__=21 __DEC_EVAL_METHOD__=2 __ELF__=1 __FINITE_MATH_ONLY__=0 __FLT_DENORM_MIN__=1.40129846432481707092e-45F __FLT_DIG__=6 __FLT_EPSILON__=1.19209289550781250000e-7F __FLT_EVAL_METHOD__=2 __FLT_HAS_DENORM__=1 __FLT_HAS_INFINITY__=1 __FLT_HAS_QUIET_NAN__=1 __FLT_MANT_DIG__=24 __FLT_MAX_10_EXP__=38 __FLT_MAX_EXP__=128 __FLT_MAX__=3.40282346638528859812e+38F __FLT_MIN_10_EXP__=(-37) __FLT_MIN_EXP__=(-125) __FLT_MIN__=1.17549435082228750797e-38F __FLT_RADIX__=2 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8=1 __GLIBC_MINOR__=12 __GLIBC__=2 __GNUC_GNU_INLINE__=1 __GNUC_MINOR__=5 __GNUC_PATCHLEVEL__=1 __GNUC__=4 __GNU_LIBRARY__=6 __GXX_ABI_VERSION=1002 __INT16_C(c)=c __INT16_MAX__=32767 __INT16_TYPE__=short\ int __INT32_C(c)=c __INT32_MAX__=2147483647 __INT32_TYPE__=int __INT64_C(c)=cLL __INT64_MAX__=9223372036854775807LL __INT64_TYPE__=long\ long\ int __INT8_C(c)=c __INT8_MAX__=127 __INT8_TYPE__=signed\ char __INTMAX_C(c)=cLL __INTMAX_MAX__=9223372036854775807LL __INTMAX_TYPE__=long\ long\ int __INTPTR_MAX__=2147483647 __INTPTR_TYPE__=int __INT_FAST16_MAX__=2147483647 __INT_FAST16_TYPE__=int __INT_FAST32_MAX__=2147483647 __INT_FAST32_TYPE__=int __INT_FAST64_MAX__=9223372036854775807LL __INT_FAST64_TYPE__=long\ long\ int __INT_FAST8_MAX__=127 __INT_FAST8_TYPE__=signed\ char __INT_LEAST16_MAX__=32767 __INT_LEAST16_TYPE__=short\ int __INT_LEAST32_MAX__=2147483647 __INT_LEAST32_TYPE__=int __INT_LEAST64_MAX__=9223372036854775807LL __INT_LEAST64_TYPE__=long\ long\ int __INT_LEAST8_MAX__=127 __INT_LEAST8_TYPE__=signed\ char __INT_MAX__=2147483647 __LDBL_DENORM_MIN__=3.64519953188247460253e-4951L __LDBL_DIG__=18 __LDBL_EPSILON__=1.08420217248550443401e-19L __LDBL_HAS_DENORM__=1 __LDBL_HAS_INFINITY__=1 __LDBL_HAS_QUIET_NAN__=1 __LDBL_MANT_DIG__=64 __LDBL_MAX_10_EXP__=4932 __LDBL_MAX_EXP__=16384 __LDBL_MAX__=1.18973149535723176502e+4932L __LDBL_MIN_10_EXP__=(-4931) __LDBL_MIN_EXP__=(-16381) __LDBL_MIN__=3.36210314311209350626e-4932L __LONG_LONG_MAX__=9223372036854775807LL __LONG_MAX__=2147483647L __PRAGMA_REDEFINE_EXTNAME=1 __PTRDIFF_MAX__=2147483647 __PTRDIFF_TYPE__=int __REGISTER_PREFIX__= __SCHAR_MAX__=127 __SHRT_MAX__=32767 __SIG_ATOMIC_MAX__=2147483647 __SIG_ATOMIC_MIN__=(-2147483647\ -\ 1) __SIG_ATOMIC_TYPE__=int __SIZEOF_DOUBLE__=8 __SIZEOF_FLOAT__=4 __SIZEOF_INT__=4 __SIZEOF_LONG_DOUBLE__=12 __SIZEOF_LONG_LONG__=8 __SIZEOF_LONG__=4 __SIZEOF_POINTER__=4 __SIZEOF_PTRDIFF_T__=4 __SIZEOF_SHORT__=2 __SIZEOF_SIZE_T__=4 __SIZEOF_WCHAR_T__=4 __SIZEOF_WINT_T__=4 __SIZE_MAX__=4294967295U __SIZE_TYPE__=unsigned\ int __STDC_HOSTED__=1 __STDC__=1 __UINT16_C(c)=c __UINT16_MAX__=65535 __UINT16_TYPE__=short\ unsigned\ int __UINT32_C(c)=cU __UINT32_MAX__=4294967295U __UINT32_TYPE__=unsigned\ int __UINT64_C(c)=cULL __UINT64_MAX__=18446744073709551615ULL __UINT64_TYPE__=long\ long\ unsigned\ int __UINT8_C(c)=c __UINT8_MAX__=255 __UINT8_TYPE__=unsigned\ char __UINTMAX_C(c)=cULL __UINTMAX_MAX__=18446744073709551615ULL __UINTMAX_TYPE__=long\ long\ unsigned\ int __UINTPTR_MAX__=4294967295U __UINTPTR_TYPE__=unsigned\ int __UINT_FAST16_MAX__=4294967295U __UINT_FAST16_TYPE__=unsigned\ int __UINT_FAST32_MAX__=4294967295U __UINT_FAST32_TYPE__=unsigned\ int __UINT_FAST64_MAX__=18446744073709551615ULL __UINT_FAST64_TYPE__=long\ long\ unsigned\ int __UINT_FAST8_MAX__=255 __UINT_FAST8_TYPE__=unsigned\ char __UINT_LEAST16_MAX__=65535 __UINT_LEAST16_TYPE__=short\ unsigned\ int __UINT_LEAST32_MAX__=4294967295U __UINT_LEAST32_TYPE__=unsigned\ int __UINT_LEAST64_MAX__=18446744073709551615ULL __UINT_LEAST64_TYPE__=long\ long\ unsigned\ int __UINT_LEAST8_MAX__=255 __UINT_LEAST8_TYPE__=unsigned\ char __USER_LABEL_PREFIX__= __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_GNU=1 __USE_LARGEFILE64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_POSIX=1 __USE_REENTRANT=1 __USE_SVID=1 __USE_UNIX98=1 __USE_XOPEN=1 __USE_XOPEN_EXTENDED=1 __VERSION__="4.5.1" __WCHAR_MAX__=2147483647L __WCHAR_MIN__=(-2147483647L\ -\ 1) __WCHAR_TYPE__=long\ int __WINT_MAX__=4294967295U __WINT_MIN__=0U __WINT_TYPE__=unsigned\ int __gnu_linux__=1 __i386=1 __i386__=1 __i586=1 __i586__=1 __linux=1 __linux__=1 __pentium=1 __pentium__=1 __tune_i586__=1 __tune_pentium__=1 __unix=1 __unix__=1 i386=1 linux=1 unix=1'
+d_nv_preserves_uv='define'
+d_printf_format_null='define'
+d_u32align='undef'
+gidformat='"lu"'
+i32type='long'
+i64type='long long'
+ivsize='4'
+longdblsize='12'
+longsize='4'
+myuname='linux qemux86 2.6.37-rc5-yocto-standard+ #1 preempt mon dec 20 14:21:27 pst 2010 i686 gnulinux '
+need_va_copy='undef'
+netdb_host_type='const void *'
+nv_preserves_uv_bits='32'
+ptrsize='4'
+quadkind='3'
+quadtype='long long'
+sGMTIME_max='2147483647'
+sGMTIME_min='-2147483648'
+sLOCALTIME_max='2147483647'
+sLOCALTIME_min='-2147483648'
+sPRIXU64='"LX"'
+sPRId64='"Ld"'
+sPRIi64='"Li"'
+sPRIo64='"Lo"'
+sPRIu64='"Lu"'
+sPRIx64='"Lx"'
+selectminbits='32'
+sizesize='4'
+u32type='unsigned long'
+u64type='unsigned long long'
+uidformat='"lu"'
+uquadtype='unsigned long long'
+use64bitall='undef'
+use64bitint='undef'
+uvsize='4'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-be b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-be
new file mode 100644
index 000000000..a59a9abb5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-be
@@ -0,0 +1 @@
+byteorder='4321'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-le b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-le
new file mode 100644
index 000000000..10e422656
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-32-le
@@ -0,0 +1 @@
+byteorder='1234'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64 b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64
new file mode 100644
index 000000000..6929d3a09
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64
@@ -0,0 +1,38 @@
+alignbytes='8'
+cf_time='Thu Dec 23 02:06:42 UTC 2010'
+cppsymbols='_FILE_OFFSET_BITS=64 _GNU_SOURCE=1 _LARGEFILE64_SOURCE=1 _LARGEFILE_SOURCE=1 _LP64=1 _POSIX_C_SOURCE=200809L _POSIX_SOURCE=1 _REENTRANT=1 _XOPEN_SOURCE=700 _XOPEN_SOURCE_EXTENDED=1 __BIGGEST_ALIGNMENT__=16 __CHAR16_TYPE__=short\ unsigned\ int __CHAR32_TYPE__=unsigned\ int __CHAR_BIT__=8 __DBL_DENORM_MIN__=((double)4.94065645841246544177e-324L) __DBL_DIG__=15 __DBL_EPSILON__=((double)2.22044604925031308085e-16L) __DBL_HAS_DENORM__=1 __DBL_HAS_INFINITY__=1 __DBL_HAS_QUIET_NAN__=1 __DBL_MANT_DIG__=53 __DBL_MAX_10_EXP__=308 __DBL_MAX_EXP__=1024 __DBL_MAX__=((double)1.79769313486231570815e+308L) __DBL_MIN_10_EXP__=(-307) __DBL_MIN_EXP__=(-1021) __DBL_MIN__=((double)2.22507385850720138309e-308L) __DEC128_EPSILON__=1E-33DL __DEC128_MANT_DIG__=34 __DEC128_MAX_EXP__=6145 __DEC128_MAX__=9.999999999999999999999999999999999E6144DL __DEC128_MIN_EXP__=(-6142) __DEC128_MIN__=1E-6143DL __DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL __DEC32_EPSILON__=1E-6DF __DEC32_MANT_DIG__=7 __DEC32_MAX_EXP__=97 __DEC32_MAX__=9.999999E96DF __DEC32_MIN_EXP__=(-94) __DEC32_MIN__=1E-95DF __DEC32_SUBNORMAL_MIN__=0.000001E-95DF __DEC64_EPSILON__=1E-15DD __DEC64_MANT_DIG__=16 __DEC64_MAX_EXP__=385 __DEC64_MAX__=9.999999999999999E384DD __DEC64_MIN_EXP__=(-382) __DEC64_MIN__=1E-383DD __DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD __DECIMAL_BID_FORMAT__=1 __DECIMAL_DIG__=21 __DEC_EVAL_METHOD__=2 __ELF__=1 __FINITE_MATH_ONLY__=0 __FLT_DENORM_MIN__=1.40129846432481707092e-45F __FLT_DIG__=6 __FLT_EPSILON__=1.19209289550781250000e-7F __FLT_EVAL_METHOD__=0 __FLT_HAS_DENORM__=1 __FLT_HAS_INFINITY__=1 __FLT_HAS_QUIET_NAN__=1 __FLT_MANT_DIG__=24 __FLT_MAX_10_EXP__=38 __FLT_MAX_EXP__=128 __FLT_MAX__=3.40282346638528859812e+38F __FLT_MIN_10_EXP__=(-37) __FLT_MIN_EXP__=(-125) __FLT_MIN__=1.17549435082228750797e-38F __FLT_RADIX__=2 __GCC_HAVE_DWARF2_CFI_ASM=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8=1 __GLIBC_MINOR__=12 __GLIBC__=2 __GNUC_GNU_INLINE__=1 __GNUC_MINOR__=5 __GNUC_PATCHLEVEL__=1 __GNUC__=4 __GNU_LIBRARY__=6 __GXX_ABI_VERSION=1002 __INT16_C(c)=c __INT16_MAX__=32767 __INT16_TYPE__=short\ int __INT32_C(c)=c __INT32_MAX__=2147483647 __INT32_TYPE__=int __INT64_C(c)=cL __INT64_MAX__=9223372036854775807L __INT64_TYPE__=long\ int __INT8_C(c)=c __INT8_MAX__=127 __INT8_TYPE__=signed\ char __INTMAX_C(c)=cL __INTMAX_MAX__=9223372036854775807L __INTMAX_TYPE__=long\ int __INTPTR_MAX__=9223372036854775807L __INTPTR_TYPE__=long\ int __INT_FAST16_MAX__=9223372036854775807L __INT_FAST16_TYPE__=long\ int __INT_FAST32_MAX__=9223372036854775807L __INT_FAST32_TYPE__=long\ int __INT_FAST64_MAX__=9223372036854775807L __INT_FAST64_TYPE__=long\ int __INT_FAST8_MAX__=127 __INT_FAST8_TYPE__=signed\ char __INT_LEAST16_MAX__=32767 __INT_LEAST16_TYPE__=short\ int __INT_LEAST32_MAX__=2147483647 __INT_LEAST32_TYPE__=int __INT_LEAST64_MAX__=9223372036854775807L __INT_LEAST64_TYPE__=long\ int __INT_LEAST8_MAX__=127 __INT_LEAST8_TYPE__=signed\ char __INT_MAX__=2147483647 __LDBL_DENORM_MIN__=3.64519953188247460253e-4951L __LDBL_DIG__=18 __LDBL_EPSILON__=1.08420217248550443401e-19L __LDBL_HAS_DENORM__=1 __LDBL_HAS_INFINITY__=1 __LDBL_HAS_QUIET_NAN__=1 __LDBL_MANT_DIG__=64 __LDBL_MAX_10_EXP__=4932 __LDBL_MAX_EXP__=16384 __LDBL_MAX__=1.18973149535723176502e+4932L __LDBL_MIN_10_EXP__=(-4931) __LDBL_MIN_EXP__=(-16381) __LDBL_MIN__=3.36210314311209350626e-4932L __LONG_LONG_MAX__=9223372036854775807LL __LONG_MAX__=9223372036854775807L __LP64__=1 __MMX__=1 __PRAGMA_REDEFINE_EXTNAME=1 __PTRDIFF_MAX__=9223372036854775807L __PTRDIFF_TYPE__=long\ int __REGISTER_PREFIX__= __SCHAR_MAX__=127 __SHRT_MAX__=32767 __SIG_ATOMIC_MAX__=2147483647 __SIG_ATOMIC_MIN__=(-2147483647\ -\ 1) __SIG_ATOMIC_TYPE__=int __SIZEOF_DOUBLE__=8 __SIZEOF_FLOAT__=4 __SIZEOF_INT__=4 __SIZEOF_LONG_DOUBLE__=16 __SIZEOF_LONG_LONG__=8 __SIZEOF_LONG__=8 __SIZEOF_POINTER__=8 __SIZEOF_PTRDIFF_T__=8 __SIZEOF_SHORT__=2 __SIZEOF_SIZE_T__=8 __SIZEOF_WCHAR_T__=4 __SIZEOF_WINT_T__=4 __SIZE_MAX__=18446744073709551615UL __SIZE_TYPE__=long\ unsigned\ int __SSE2_MATH__=1 __SSE2__=1 __SSE_MATH__=1 __SSE__=1 __STDC_HOSTED__=1 __STDC__=1 __UINT16_C(c)=c __UINT16_MAX__=65535 __UINT16_TYPE__=short\ unsigned\ int __UINT32_C(c)=cU __UINT32_MAX__=4294967295U __UINT32_TYPE__=unsigned\ int __UINT64_C(c)=cUL __UINT64_MAX__=18446744073709551615UL __UINT64_TYPE__=long\ unsigned\ int __UINT8_C(c)=c __UINT8_MAX__=255 __UINT8_TYPE__=unsigned\ char __UINTMAX_C(c)=cUL __UINTMAX_MAX__=18446744073709551615UL __UINTMAX_TYPE__=long\ unsigned\ int __UINTPTR_MAX__=18446744073709551615UL __UINTPTR_TYPE__=long\ unsigned\ int __UINT_FAST16_MAX__=18446744073709551615UL __UINT_FAST16_TYPE__=long\ unsigned\ int __UINT_FAST32_MAX__=18446744073709551615UL __UINT_FAST32_TYPE__=long\ unsigned\ int __UINT_FAST64_MAX__=18446744073709551615UL __UINT_FAST64_TYPE__=long\ unsigned\ int __UINT_FAST8_MAX__=255 __UINT_FAST8_TYPE__=unsigned\ char __UINT_LEAST16_MAX__=65535 __UINT_LEAST16_TYPE__=short\ unsigned\ int __UINT_LEAST32_MAX__=4294967295U __UINT_LEAST32_TYPE__=unsigned\ int __UINT_LEAST64_MAX__=18446744073709551615UL __UINT_LEAST64_TYPE__=long\ unsigned\ int __UINT_LEAST8_MAX__=255 __UINT_LEAST8_TYPE__=unsigned\ char __USER_LABEL_PREFIX__= __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_GNU=1 __USE_LARGEFILE64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_POSIX=1 __USE_REENTRANT=1 __USE_SVID=1 __USE_UNIX98=1 __USE_XOPEN=1 __USE_XOPEN_EXTENDED=1 __VERSION__="4.5.1" __WCHAR_MAX__=2147483647 __WCHAR_MIN__=(-2147483647\ -\ 1) __WCHAR_TYPE__=int __WINT_MAX__=4294967295U __WINT_MIN__=0U __WINT_TYPE__=unsigned\ int __amd64=1 __amd64__=1 __gnu_linux__=1 __k8=1 __k8__=1 __linux=1 __linux__=1 __unix=1 __unix__=1 __x86_64=1 __x86_64__=1 linux=1 unix=1'
+d_nv_preserves_uv='undef'
+d_printf_format_null='undef'
+d_u32align='define'
+gidformat='"u"'
+i32type='int'
+i64type='long'
+ivsize='8'
+longdblsize='16'
+longsize='8'
+myuname='linux qemux86-64 2.6.37-rc5-yocto-standard+ #1 smp preempt mon dec 20 17:19:50 pst 2010 x86_64 gnulinux '
+need_va_copy='define'
+netdb_host_type='char *'
+nv_preserves_uv_bits='53'
+ptrsize='8'
+quadkind='2'
+quadtype='long'
+sGMTIME_max='67768036191676799'
+sGMTIME_min='-62167219200'
+sLOCALTIME_max='67768036191676799'
+sLOCALTIME_min='-62167219200'
+sPRIXU64='"lX"'
+sPRId64='"ld"'
+sPRIi64='"li"'
+sPRIo64='"lo"'
+sPRIu64='"lu"'
+sPRIx64='"lx"'
+selectminbits='64'
+sizesize='8'
+u32type='unsigned int'
+u64type='unsigned long'
+uidformat='"u"'
+uquadtype='unsigned long'
+use64bitall='define'
+use64bitint='define'
+uvsize='8'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-be b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-be
new file mode 100644
index 000000000..c08ce3c43
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-be
@@ -0,0 +1 @@
+byteorder='87654321'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-le b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-le
new file mode 100644
index 000000000..277d2a9be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/config.sh-64-le
@@ -0,0 +1 @@
+byteorder='12345678'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch
new file mode 100644
index 000000000..a00ad61d9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch
@@ -0,0 +1,15 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.14.2/Makefile.SH
+===================================================================
+--- perl-5.14.2.orig/Makefile.SH
++++ perl-5.14.2/Makefile.SH
+@@ -622,7 +622,7 @@ bitcount.h: generate_uudmap$(HOST_EXE_EX
+ $(RUN) ./generate_uudmap$(HOST_EXE_EXT) uudmap.h bitcount.h
+
+ generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
+- $(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs)
++ $(BUILD_CC) -o generate_uudmap$(EXE_EXT) generate_uudmap.c
+
+ miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
+ $(CCCMD) $(PLDLFLAGS) $*.c
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff
new file mode 100644
index 000000000..a63b96831
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff
@@ -0,0 +1,62 @@
+From d33d46963035ef726144dc66be2ae9c00aec0333 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Tue, 16 Oct 2012 23:07:56 +0300
+Subject: Fix CPAN::FirstTime defaults with nonexisting site dirs if a parent
+ is writable
+
+The site directories do not exist on a typical Debian system. The build
+systems will create them when necessary, so there's no need for a prompt
+suggesting local::lib if the first existing parent directory is writable.
+
+Also, writability of the core directories is not interesting as we
+explicitly tell CPAN not to touch those with INSTALLDIRS=site.
+
+Bug-Debian: http://bugs.debian.org/688842
+Patch-Name: debian/cpan-missing-site-dirs.diff
+---
+ cpan/CPAN/lib/CPAN/FirstTime.pm | 31 +++++++++++++++++++++++++++----
+ 1 file changed, 27 insertions(+), 4 deletions(-)
+
+diff --git a/cpan/CPAN/lib/CPAN/FirstTime.pm b/cpan/CPAN/lib/CPAN/FirstTime.pm
+index 33054cd..7b0becf 100644
+--- a/cpan/CPAN/lib/CPAN/FirstTime.pm
++++ b/cpan/CPAN/lib/CPAN/FirstTime.pm
+@@ -2057,11 +2057,34 @@ sub _print_urllist {
+ };
+ }
+
++# Debian modification: return true if this directory
++# or the first existing one upwards is writable
++sub _can_write_to_this_or_parent {
++ my ($dir) = @_;
++ my @parts = File::Spec->splitdir($dir);
++ while (@parts) {
++ my $cur = File::Spec->catdir(@parts);
++ return 1 if -w $cur;
++ return 0 if -e _;
++ pop @parts;
++ }
++ return 0;
++}
++
++# Debian specific modification: the site directories don't necessarily
++# exist on the system, but the build systems create them when necessary,
++# so return true if the first existing directory upwards is writable
++#
++# Furthermore, on Debian, only test the site directories
++# (installsite*, expanded to /usr/local/{share,lib}/perl),
++# not the core ones
++# (install*lib, expanded to /usr/{share,lib}/perl).
++# We pass INSTALLDIRS=site by default to keep CPAN from touching
++# the core directories.
++
+ sub _can_write_to_libdirs {
+- return -w $Config{installprivlib}
+- && -w $Config{installarchlib}
+- && -w $Config{installsitelib}
+- && -w $Config{installsitearch}
++ return _can_write_to_this_or_parent($Config{installsitelib})
++ && _can_write_to_this_or_parent($Config{installsitearch})
+ }
+
+ sub _using_installbase {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff
new file mode 100644
index 000000000..6b5295045
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff
@@ -0,0 +1,37 @@
+From 5ff1f21484aab68efe321ff4ba5d35928f72af96 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Provide a sensible INSTALLDIRS default for modules installed from
+ CPAN.
+
+Some modules which are included in core set INSTALLDIRS => 'perl'
+explicitly in Makefile.PL or Build.PL. This makes sense for the normal @INC
+ordering, but not ours.
+
+Patch-Name: debian/cpan_definstalldirs.diff
+---
+ cpan/CPAN/lib/CPAN/FirstTime.pm | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cpan/CPAN/lib/CPAN/FirstTime.pm b/cpan/CPAN/lib/CPAN/FirstTime.pm
+index 918e009..33054cd 100644
+--- a/cpan/CPAN/lib/CPAN/FirstTime.pm
++++ b/cpan/CPAN/lib/CPAN/FirstTime.pm
+@@ -1024,7 +1024,7 @@ sub init {
+ my_prompt_loop(prefer_installer => 'MB', $matcher, 'MB|EUMM|RAND');
+
+ if (!$matcher or 'makepl_arg make_arg' =~ /$matcher/) {
+- my_dflt_prompt(makepl_arg => "", $matcher);
++ my_dflt_prompt(makepl_arg => "INSTALLDIRS=site", $matcher);
+ my_dflt_prompt(make_arg => "", $matcher);
+ if ( $CPAN::Config->{makepl_arg} =~ /LIBS=|INC=/ ) {
+ $CPAN::Frontend->mywarn(
+@@ -1056,7 +1056,7 @@ sub init {
+ my_dflt_prompt(make_install_arg => $CPAN::Config->{make_arg} || "",
+ $matcher);
+
+- my_dflt_prompt(mbuildpl_arg => "", $matcher);
++ my_dflt_prompt(mbuildpl_arg => "--installdirs site", $matcher);
+ my_dflt_prompt(mbuild_arg => "", $matcher);
+
+ if (exists $CPAN::HandleConfig::keys{mbuild_install_build_command}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff
new file mode 100644
index 000000000..280bf1170
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff
@@ -0,0 +1,34 @@
+From 01421f8a80d5c623959695ba2b8167f30112d333 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 overly restrictive DB_File version check.
+
+Bug-Debian: http://bugs.debian.org/340047
+
+Package dependencies ensure the correct library is linked at run-time.
+
+Patch-Name: debian/db_file_ver.diff
+---
+ cpan/DB_File/version.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/cpan/DB_File/version.c b/cpan/DB_File/version.c
+index e01f6f6..544e6ee 100644
+--- a/cpan/DB_File/version.c
++++ b/cpan/DB_File/version.c
+@@ -48,6 +48,7 @@ __getBerkeleyDBInfo()
+
+ (void)db_version(&Major, &Minor, &Patch) ;
+
++#ifndef DEBIAN
+ /* Check that the versions of db.h and libdb.a are the same */
+ if (Major != DB_VERSION_MAJOR || Minor != DB_VERSION_MINOR )
+ /* || Patch != DB_VERSION_PATCH) */
+@@ -55,6 +56,7 @@ __getBerkeleyDBInfo()
+ croak("\nDB_File was build with libdb version %d.%d.%d,\nbut you are attempting to run it with libdb version %d.%d.%d\n",
+ DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
+ Major, Minor, Patch) ;
++#endif /* DEBIAN */
+
+ /* check that libdb is recent enough -- we need 2.3.4 or greater */
+ if (Major == 2 && (Minor < 3 || (Minor == 3 && Patch < 4)))
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff
new file mode 100644
index 000000000..601ee4c30
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff
@@ -0,0 +1,56 @@
+From def4aa3817f98aae625e601b791ef068276f05d5 Mon Sep 17 00:00:00 2001
+From: Dominic Hargreaves <dom@earth.li>
+Date: Mon, 17 May 2010 13:23:07 +0300
+Subject: Point users to Debian packages of deprecated core modules
+
+Bug-Debian: http://bugs.debian.org/747628
+
+Several modules are being deprecated with perl 5.20.
+To get a clean transition, perl/perl-modules is going to recommend the
+separate Debian packages of these for one release cycle so that they will be
+pulled in by default on upgrades. This is taking place for perl 5.20/jessie.
+
+However, on systems configured to ignore recommendations the deprecation
+warnings will still be useful, so modify them slightly to point to the
+separate packages instead.
+
+Patch-Name: debian/deprecate-with-apt.diff
+---
+ lib/deprecate.pm | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/lib/deprecate.pm b/lib/deprecate.pm
+index 47bc112..b0c61df 100644
+--- a/lib/deprecate.pm
++++ b/lib/deprecate.pm
+@@ -7,6 +7,13 @@ our $VERSION = 0.03;
+ our %Config;
+ unless (%Config) { require Config; *Config = \%Config::Config; }
+
++# Debian-specific change: recommend the separate Debian packages of
++# deprecated modules where available
++
++our %DEBIAN_PACKAGES = (
++ # None for the perl 5.22 cycle
++);
++
+ # This isn't a public API. It's internal to code maintained by the perl-porters
+ # If you would like it to be a public API, please send a patch with
+ # documentation and tests. Until then, it may change without warning.
+@@ -58,9 +65,15 @@ EOM
+ if (defined $callers_bitmask
+ && (vec($callers_bitmask, $warnings::Offsets{deprecated}, 1)
+ || vec($callers_bitmask, $warnings::Offsets{all}, 1))) {
+- warn <<"EOM";
++ if (my $deb = $DEBIAN_PACKAGES{$package}) {
++ warn <<"EOM";
++$package will be removed from the Perl core distribution in the next major release. Please install the separate $deb package. It is being used at $call_file, line $call_line.
++EOM
++ } else {
++ warn <<"EOM";
+ $package will be removed from the Perl core distribution in the next major release. Please install it from CPAN. It is being used at $call_file, line $call_line.
+ EOM
++ }
+ }
+ }
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/doc_info.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/doc_info.diff
new file mode 100644
index 000000000..fbea2ee22
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/doc_info.diff
@@ -0,0 +1,35 @@
+From e18f81e69c55d698abd293e71063d6b6b275cc07 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: Replace generic man(1) instructions with Debian-specific information.
+
+Indicate that the user needs to install the perl-doc package.
+
+Patch-Name: debian/doc_info.diff
+---
+ pod/perl.pod | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/pod/perl.pod b/pod/perl.pod
+index 364e957..f97e103 100644
+--- a/pod/perl.pod
++++ b/pod/perl.pod
+@@ -291,8 +291,16 @@ aux c2ph h2ph h2xs perlbug pl2pm pod2html pod2man splain xsubpp
+
+ =for buildtoc __END__
+
+-On a Unix-like system, these documentation files will usually also be
+-available as manpages for use with the F<man> program.
++On Debian systems, you need to install the B<perl-doc> package which
++contains the majority of the standard Perl documentation and the
++F<perldoc> program.
++
++Extensive additional documentation for Perl modules is available, both
++those distributed with Perl and third-party modules which are packaged
++or locally installed.
++
++You should be able to view Perl's documentation with your man(1)
++program or perldoc(1).
+
+ Some documentation is not available as man pages, so if a
+ cross-reference is not found by man, try it with L<perldoc>. Perldoc can
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff
new file mode 100644
index 000000000..e074b20fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff
@@ -0,0 +1,70 @@
+From 7fe59a3d0601c6d8634eae4f99dae3024cd02a92 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Tweak enc2xs to follow symlinks and ignore missing @INC directories.
+
+Bug-Debian: http://bugs.debian.org/290336
+
+- ignore missing directories,
+- follow symlinks (/usr/share/perl/5.8 -> 5.8.4).
+- filter "." out when running "enc2xs -C", it's unnecessary and causes
+ issues with follow => 1 (see #603686 and [rt.cpan.org #64585])
+
+Patch-Name: debian/enc2xs_inc.diff
+---
+ cpan/Encode/bin/enc2xs | 8 ++++----
+ t/porting/customized.t | 3 +++
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/cpan/Encode/bin/enc2xs b/cpan/Encode/bin/enc2xs
+index 19f2b2b..4d64e38 100644
+--- a/cpan/Encode/bin/enc2xs
++++ b/cpan/Encode/bin/enc2xs
+@@ -944,11 +944,11 @@ use vars qw(
+ sub find_e2x{
+ eval { require File::Find; };
+ my (@inc, %e2x_dir);
+- for my $inc (@INC){
++ for my $inc (grep -d, @INC){
+ push @inc, $inc unless $inc eq '.'; #skip current dir
+ }
+ File::Find::find(
+- sub {
++ { wanted => sub {
+ my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+ $atime,$mtime,$ctime,$blksize,$blocks)
+ = lstat($_) or return;
+@@ -958,7 +958,7 @@ sub find_e2x{
+ $e2x_dir{$File::Find::dir} ||= $mtime;
+ }
+ return;
+- }, @inc);
++ }, follow => 1}, @inc);
+ warn join("\n", keys %e2x_dir), "\n";
+ for my $d (sort {$e2x_dir{$a} <=> $e2x_dir{$b}} keys %e2x_dir){
+ $_E2X = $d;
+@@ -1025,7 +1025,7 @@ sub make_configlocal_pm {
+ $LocalMod{$enc} ||= $mod;
+ }
+ };
+- File::Find::find({wanted => $wanted}, @INC);
++ File::Find::find({wanted => $wanted, follow => 1}, grep -d && !/^\./, @INC);
+ $_ModLines = "";
+ for my $enc ( sort keys %LocalMod ) {
+ $_ModLines .=
+diff --git a/t/porting/customized.t b/t/porting/customized.t
+index 45fcafb..3bd6adb 100644
+--- a/t/porting/customized.t
++++ b/t/porting/customized.t
+@@ -101,8 +101,11 @@ foreach my $module ( sort keys %Modules ) {
+ print $data_fh join(' ', $module, $file, $id), "\n";
+ next;
+ }
++SKIP: {
++ skip("$file modified for Debian", 1) if $file eq 'cpan/Encode/bin/enc2xs';
+ my $should_be = $customised{ $module }->{ $file };
+ is( $id, $should_be, "SHA for $file matches stashed SHA" );
++}
+ }
+ }
+
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
new file mode 100644
index 000000000..bcb59c69e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff
@@ -0,0 +1,35 @@
+From 827eee225897c35ec97194a5971bf4bfcf250748 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.
+
+Bug-Debian: http://bugs.debian.org/343351
+
+Remove version check which can cause problems for long running
+processes embedding perl when upgrading to a newer version,
+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
+--- a/ext/Errno/Errno_pm.PL
++++ b/ext/Errno/Errno_pm.PL
+@@ -278,13 +278,8 @@ sub write_errno_pm {
+
+ package Errno;
+ require Exporter;
+-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';
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff
new file mode 100644
index 000000000..adb4bd991
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff
@@ -0,0 +1,37 @@
+From 431275078b0490d2e092442d9582be06bb95b354 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sat, 10 May 2014 23:34:14 +0300
+Subject: EU:MM: set location of libperl.a under /usr/lib
+
+The Debian packaging moves libperl.a a couple of levels up from the
+CORE directory to match other static libraries.
+
+Patch-Name: debian/extutils_set_libperl_path.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 2 +-
+ pp.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 5f1b87f..570a631 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2505,7 +2505,7 @@ MAP_PRELIBS = $Config{perllibs} $Config{cryptlib}
+ ($lperl = $libperl) =~ s/\$\(A\)/$self->{LIB_EXT}/;
+ }
+ unless ($libperl && -f $lperl) { # Ilya's code...
+- my $dir = $self->{PERL_SRC} || "$self->{PERL_ARCHLIB}/CORE";
++ my $dir = $self->{PERL_SRC} || "$self->{PERL_ARCHLIB}/../..";
+ $dir = "$self->{PERL_ARCHLIB}/.." if $self->{UNINSTALLED_PERL};
+ $libperl ||= "libperl$self->{LIB_EXT}";
+ $libperl = "$dir/$libperl";
+diff --git a/pp.c b/pp.c
+index 42f156a..77c1279 100644
+--- a/pp.c
++++ b/pp.c
+@@ -1,4 +1,4 @@
+-/* pp.c
++ /* pp.c
+ *
+ * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ * 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by Larry Wall and others
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fakeroot.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fakeroot.diff
new file mode 100644
index 000000000..ec461cfe5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fakeroot.diff
@@ -0,0 +1,42 @@
+From 27ae7b18078d801a2c943aa6de2f7e9808177251 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: Postpone LD_LIBRARY_PATH evaluation to the binary targets.
+
+Modify the setting of LD_LIBRARY_PATH to append pre-existing values at the
+time the rule is evaluated rather than when the Makefile is created.
+
+This is required when building packages with dpkg-buildpackage and fakeroot,
+since fakeroot (which now sets LD_LIBRARY_PATH) is not used for the "build"
+rule where the Makefile is created, but is for the clean/binary* targets.
+
+Patch-Name: debian/fakeroot.diff
+---
+ Makefile.SH | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.SH b/Makefile.SH
+index 034d812..04dd7d5 100755
+--- a/Makefile.SH
++++ b/Makefile.SH
+@@ -39,10 +39,7 @@ case "$useshrplib" in
+ true)
+ # Prefix all runs of 'miniperl' and 'perl' with
+ # $ldlibpth so that ./perl finds *this* shared libperl.
+- case "$LD_LIBRARY_PATH" in
+- '') ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `" ;;
+- *) ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `:` quote "$LD_LIBRARY_PATH" `" ;;
+- esac
++ ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `"'$${LD_LIBRARY_PATH:+:}$$LD_LIBRARY_PATH'
+
+ pldlflags="$cccdlflags"
+ static_ldflags=''
+@@ -113,7 +110,7 @@ true)
+ ;;
+ esac
+ case "$ldlibpthname" in
+- '') ;;
++ ''|LD_LIBRARY_PATH) ;;
+ *)
+ case "$osname" in
+ os2)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/find_html2text.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/find_html2text.diff
new file mode 100644
index 000000000..d319e7518
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/find_html2text.diff
@@ -0,0 +1,35 @@
+From c81dbdedff9e9b4fb75ac028aa718838c0292d2f Mon Sep 17 00:00:00 2001
+From: Andreas Marschke <andreas.marschke@googlemail.com>
+Date: Sat, 17 Sep 2011 11:38:42 +0100
+Subject: Configure CPAN::Distribution with correct name of html2text
+
+Bug-Debian: http://bugs.debian.org/640479
+Patch-Name: debian/find_html2text.diff
+
+If you use cpan from Debian you usually wind up trying to read online
+documentation through it. Unfortunately cpan can't find the
+html2text.pl script even though it is installed using the Debian
+package 'html2text'.
+
+Please see the attached patch for a quick fix of this issue.
+
+[Maintainer's note: html2text in Debian is not the same implementation
+as the html2text.pl which is expected, but should provide similar
+functionality].
+---
+ cpan/CPAN/lib/CPAN/Distribution.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpan/CPAN/lib/CPAN/Distribution.pm b/cpan/CPAN/lib/CPAN/Distribution.pm
+index 092b781..5c2bae1 100644
+--- a/cpan/CPAN/lib/CPAN/Distribution.pm
++++ b/cpan/CPAN/lib/CPAN/Distribution.pm
+@@ -4099,7 +4099,7 @@ sub _display_url {
+ if $CPAN::DEBUG;
+
+ # should we define it in the config instead?
+- my $html_converter = "html2text.pl";
++ my $html_converter = "html2text";
+
+ my $web_browser = $CPAN::Config->{'lynx'} || undef;
+ my $web_browser_out = $web_browser
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff
new file mode 100644
index 000000000..61a92712e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff
@@ -0,0 +1,31 @@
+From 9faf6dcc3a5c4154484d812eb3cc3dd78b35563b Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Mon, 30 May 2011 22:54:24 +0300
+Subject: Document that CCFLAGS should include $Config{ccflags}
+
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=68613
+Bug-Debian: http://bugs.debian.org/628522
+
+Compiling XS extensions without $Config{ccflags} can break the
+binary interface on some platforms.
+
+Patch-Name: fixes/document_makemaker_ccflags.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
+index fe95b27..90403e8 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
+@@ -1774,6 +1774,10 @@ currently used by MakeMaker but may be handy in Makefile.PLs.
+ String that will be included in the compiler call command line between
+ the arguments INC and OPTIMIZE.
+
++The default value is taken from $Config{ccflags}. When overriding
++CCFLAGS, make sure to include the $Config{ccflags} settings to avoid
++binary incompatibilities.
++
+ =item CONFIG
+
+ Arrayref. E.g. [qw(archname manext)] defines ARCHNAME & MANEXT from
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff
new file mode 100644
index 000000000..525f962c1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff
@@ -0,0 +1,110 @@
+From 55d430eb02fc116581847304ca20321687978269 Mon Sep 17 00:00:00 2001
+From: Jonathan Nieder <jrnieder@gmail.com>
+Date: Fri, 27 Jul 2012 10:35:07 -0500
+Subject: Memoize::Storable: respect 'nstore' option not respected
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Memoize(3perl) says:
+
+ tie my %cache => 'Memoize::Storable', $filename, 'nstore';
+ memoize 'function', SCALAR_CACHE => [HASH => \%cache];
+
+ Include the ‘nstore’ option to have the "Storable" database
+ written in ‘network order’. (See Storable for more details
+ about this.)
+
+In fact the "nstore" option does no such thing. Option parsing looks
+like this:
+
+ @options{@_} = ();
+
+$self->{OPTIONS}{'nstore'} is accordingly set to undef. Later
+Memoize::Storable checks if the option is true, and since undef is
+not true, the "else" branch is always taken.
+
+ if ($self->{OPTIONS}{'nstore'}) {
+ Storable::nstore($self->{H}, $self->{FILENAME});
+ } else {
+ Storable::store($self->{H}, $self->{FILENAME});
+ }
+
+Correcting the condition to (exists $self->{OPTIONS}{'nstore'}) fixes
+it.
+
+Noticed because git-svn, which uses the 'nstore' option for its
+on-disk caches, was producing
+
+ Byte order is not compatible at ../../lib/Storable.pm
+
+when run using a perl with a different integer size (and hence
+byteorder).
+
+Reported by Tim Retout (RT#77790)
+
+Bug-Debian: http://bugs.debian.org/587650
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=77790
+Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=77790
+Patch-Name: fixes/memoize_storable_nstore.diff
+---
+ cpan/Memoize/Memoize/Storable.pm | 2 +-
+ cpan/Memoize/t/tie_storable.t | 24 ++++++++++++++++++++----
+ 2 files changed, 21 insertions(+), 5 deletions(-)
+
+diff --git a/cpan/Memoize/Memoize/Storable.pm b/cpan/Memoize/Memoize/Storable.pm
+index 1314797..87876f2 100644
+--- a/cpan/Memoize/Memoize/Storable.pm
++++ b/cpan/Memoize/Memoize/Storable.pm
+@@ -55,7 +55,7 @@ sub DESTROY {
+ require Carp if $Verbose;
+ my $self= shift;
+ print STDERR "Memoize::Storable::DESTROY(@_)\n" if $Verbose;
+- if ($self->{OPTIONS}{'nstore'}) {
++ if (exists $self->{OPTIONS}{'nstore'}) {
+ Storable::nstore($self->{H}, $self->{FILENAME});
+ } else {
+ Storable::store($self->{H}, $self->{FILENAME});
+diff --git a/cpan/Memoize/t/tie_storable.t b/cpan/Memoize/t/tie_storable.t
+index de3b8dc..a624238 100644
+--- a/cpan/Memoize/t/tie_storable.t
++++ b/cpan/Memoize/t/tie_storable.t
+@@ -31,18 +31,34 @@ if ($@) {
+ exit 0;
+ }
+
+-print "1..4\n";
++print "1..9\n";
+
+ $file = "storable$$";
+ 1 while unlink $file;
+ tryout('Memoize::Storable', $file, 1); # Test 1..4
+ 1 while unlink $file;
++tryout('Memoize::Storable', $file, 5, 'nstore'); # Test 5..8
++assert_netorder($file, 9); # Test 9
++1 while unlink $file;
++
++
++sub assert_netorder {
++ my ($file, $testno) = @_;
++
++ my $netorder = Storable::file_magic($file)->{'netorder'};
++ print ($netorder ? "ok $testno\n" : "not ok $testno\n");
++}
+
+ sub tryout {
+- my ($tiepack, $file, $testno) = @_;
++ my ($tiepack, $file, $testno, $option) = @_;
+
+- tie my %cache => $tiepack, $file
+- or die $!;
++ if (defined $option) {
++ tie my %cache => $tiepack, $file, $option
++ or die $!;
++ } else {
++ tie my %cache => $tiepack, $file
++ or die $!;
++ }
+
+ memoize 'c5',
+ SCALAR_CACHE => [HASH => \%cache],
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff
new file mode 100644
index 000000000..3c31972c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff
@@ -0,0 +1,25 @@
+From fa085fedd9c406edcd4a1a256c025d5ff7f6c6de Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Thu, 20 Sep 2007 19:47:14 +1000
+Subject: Document the Net::SMTP 'Port' option
+
+Bug-Debian: http://bugs.debian.org/100195
+Bug: http://rt.cpan.org/Public/Bug/Display.html?id=36038
+
+Patch-Name: fixes/net_smtp_docs.diff
+---
+ cpan/libnet/lib/Net/SMTP.pm | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cpan/libnet/lib/Net/SMTP.pm b/cpan/libnet/lib/Net/SMTP.pm
+index afd017a..6ae7d9e 100644
+--- a/cpan/libnet/lib/Net/SMTP.pm
++++ b/cpan/libnet/lib/Net/SMTP.pm
+@@ -738,6 +738,7 @@ Net::SMTP will attempt to extract the address from the value passed.
+
+ B<Debug> - Enable debugging information
+
++B<Port> - Select a port on the remote host to connect to (default is 25)
+
+ Example:
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff
new file mode 100644
index 000000000..b5564fdbc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff
@@ -0,0 +1,73 @@
+From 0ecf83f259db09cb38cb37c9b22e72be185afa8f Mon Sep 17 00:00:00 2001
+From: Hugo van der Sanden <hv@crypt.org>
+Date: Thu, 11 Jun 2015 12:25:40 +0100
+Subject: fix -Cnn parsing
+
+Commit 22ff313068 for [perl #123814] inadvertently changed the logic when
+parsing a numeric parameter to the -C option, such that the successfully
+parsed number was not saved as the option value if it parsed to the end
+of the argument.
+
+Bug: https://rt.perl.org/Ticket/Display.html?id=125381
+Bug-Debian: https://bugs.debian.org/788636
+Origin: upstream, http://perl5.git.perl.org/perl.git/commit/89d84ff965
+Patch-Name: fixes/perl-Cnn.diff
+---
+ t/run/switchC.t | 7 ++++++-
+ util.c | 17 ++++++++---------
+ 2 files changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/t/run/switchC.t b/t/run/switchC.t
+index f6aa868..4f63c3b 100644
+--- a/t/run/switchC.t
++++ b/t/run/switchC.t
+@@ -11,7 +11,7 @@ BEGIN {
+ skip_all_if_miniperl('-C and $ENV{PERL_UNICODE} are disabled on miniperl');
+ }
+
+-plan(tests => 13);
++plan(tests => 14);
+
+ my $r;
+
+@@ -25,6 +25,11 @@ $r = runperl( switches => [ '-CO', '-w' ],
+ stderr => 1 );
+ like( $r, qr/^$b(?:\r?\n)?$/s, '-CO: no warning on UTF-8 output' );
+
++$r = runperl( switches => [ '-C2', '-w' ],
++ prog => 'print chr(256)',
++ stderr => 1 );
++like( $r, qr/^$b(?:\r?\n)?$/s, '-C2: no warning on UTF-8 output' );
++
+ SKIP: {
+ if (exists $ENV{PERL_UNICODE} &&
+ ($ENV{PERL_UNICODE} eq "" || $ENV{PERL_UNICODE} =~ /[SO]/)) {
+diff --git a/util.c b/util.c
+index 8cf62f5..ee23314 100644
+--- a/util.c
++++ b/util.c
+@@ -4420,16 +4420,15 @@ Perl_parse_unicode_opts(pTHX_ const char **popt)
+ if (isDIGIT(*p)) {
+ const char* endptr;
+ UV uv;
+- if (grok_atoUV(p, &uv, &endptr)
+- && uv <= U32_MAX
+- && (p = endptr)
+- && *p && *p != '\n' && *p != '\r'
+- ) {
++ if (grok_atoUV(p, &uv, &endptr) && uv <= U32_MAX) {
+ opt = (U32)uv;
+- if (isSPACE(*p))
+- goto the_end_of_the_opts_parser;
+- else
+- Perl_croak(aTHX_ "Unknown Unicode option letter '%c'", *p);
++ p = endptr;
++ if (p && *p && *p != '\n' && *p != '\r') {
++ if (isSPACE(*p))
++ goto the_end_of_the_opts_parser;
++ else
++ Perl_croak(aTHX_ "Unknown Unicode option letter '%c'", *p);
++ }
+ }
+ }
+ else {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff
new file mode 100644
index 000000000..7c9ca867a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff
@@ -0,0 +1,170 @@
+From 9057adc106d6bbef53c9e706523cd94f1a7a08d4 Mon Sep 17 00:00:00 2001
+From: Russ Allbery <rra@debian.org>
+Date: Sat, 30 Aug 2014 15:10:41 -0700
+Subject: Support POD_MAN_DATE in Pod::Man for the left-hand footer
+
+Honor the environment variable POD_MAN_DATE and use its contents, if
+set, as the value of the left-hand footer if the date option is not
+set, overriding the timestamp of the input file. This is primarily
+useful to ensure reproducible builds of the same output file given the
+same souce and Pod::Man version, even when file timestamps may not be
+consistent. Thanks, Niko Tyni.
+
+Bug-Debian: http://bugs.debian.org/759405
+Origin: upstream
+Patch-Name: fixes/pod_man_reproducible_date.diff
+---
+ cpan/podlators/lib/Pod/Man.pm | 69 +++++++++++++++++++++++++++++++-----------
+ cpan/podlators/t/devise-date.t | 29 +++++++++++++-----
+ 2 files changed, 72 insertions(+), 26 deletions(-)
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index 72ca9ff..0536662 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -876,25 +876,42 @@ sub devise_title {
+ }
+
+ # Determine the modification date and return that, properly formatted in ISO
+-# format. If we can't get the modification date of the input, instead use the
+-# current time. Pod::Simple returns a completely unuseful stringified file
+-# handle as the source_filename for input from a file handle, so we have to
+-# deal with that as well.
++# format.
++#
++# If POD_MAN_DATE is set, that overrides anything else. This can be used for
++# reproducible generation of the same file even if the input file timestamps
++# are unpredictable or the POD coms from standard input.
++#
++# Otherwise, use the modification date of the input if we can stat it. Be
++# aware that Pod::Simple returns the stringification of the file handle as
++# source_filename for input from a file handle, so we'll stat some random ref
++# string in that case. If that fails, instead use the current time.
++#
++# $self - Pod::Man object, used to get the source file
++#
++# Returns: YYYY-MM-DD date suitable for the left-hand footer
+ sub devise_date {
+ my ($self) = @_;
++
++ # If POD_MAN_DATE is set, always use it.
++ if ($ENV{POD_MAN_DATE}) {
++ return $ENV{POD_MAN_DATE};
++ }
++
++ # Otherwise, get the input filename and try to stat it. If that fails,
++ # use the current time.
+ my $input = $self->source_filename;
+ my $time;
+ if ($input) {
+- $time = (stat $input)[9] || time;
++ $time = (stat($input))[9] || time();
+ } else {
+- $time = time;
++ $time = time();
+ }
+
+- # Can't use POSIX::strftime(), which uses Fcntl, because MakeMaker
+- # uses this and it has to work in the core which can't load dynamic
+- # libraries.
+- my ($year, $month, $day) = (localtime $time)[5,4,3];
+- return sprintf ("%04d-%02d-%02d", $year + 1900, $month + 1, $day);
++ # Can't use POSIX::strftime(), which uses Fcntl, because MakeMaker uses
++ # this and it has to work in the core which can't load dynamic libraries.
++ my ($year, $month, $day) = (localtime($time))[5,4,3];
++ return sprintf("%04d-%02d-%02d", $year + 1900, $month + 1, $day);
+ }
+
+ # Print out the preamble and the title. The meaning of the arguments to .TH
+@@ -1632,6 +1649,15 @@ argument.
+ Sets the centered page header to use instead of "User Contributed Perl
+ Documentation".
+
++=item date
++
++Sets the left-hand footer. If this option is not set, the contents of the
++environment variable POD_MAN_DATE, if set, will be used. Failing that,
++the modification date of the input file will be used, or the current time
++if stat() can't find that file (which will be the case if the input is
++from C<STDIN>). If obtained from the file modification date or the
++current time, he date will be formatted as C<YYYY-MM-DD>.
++
+ =item errors
+
+ How to report errors. C<die> says to throw an exception on any POD
+@@ -1642,13 +1668,6 @@ POD errors entirely, as much as possible.
+
+ The default is C<pod>.
+
+-=item date
+-
+-Sets the left-hand footer. By default, the modification date of the input
+-file will be used, or the current date if stat() can't find that file (the
+-case if the input is from C<STDIN>), and the date will be formatted as
+-C<YYYY-MM-DD>.
+-
+ =item fixed
+
+ The fixed-width font to use for verbatim text and code. Defaults to
+@@ -1810,6 +1829,20 @@ option was set to C<die>.
+
+ =back
+
++=head1 ENVIRONMENT
++
++=over 4
++
++=item POD_MAN_DATE
++
++If set, this will be used as the value of the left-hand footer unless the
++C<date> option is explicitly set, overriding the timestamp of the input
++file or the current time. This is primarily useful to ensure reproducible
++builds of the same output file given the same souce and Pod::Man version,
++even when file timestamps may not be consistent.
++
++=back
++
+ =head1 BUGS
+
+ Encoding handling assumes that PerlIO is available and does not work
+diff --git a/cpan/podlators/t/devise-date.t b/cpan/podlators/t/devise-date.t
+index 3cce9f5..c610dd9 100644
+--- a/cpan/podlators/t/devise-date.t
++++ b/cpan/podlators/t/devise-date.t
+@@ -1,15 +1,28 @@
+-#!/usr/bin/perl -w
+-
+-# In order for MakeMaker to build in the core, nothing can use
+-# Fcntl which includes POSIX. devise_date()'s use of strftime()
+-# was replaced. This tests that it's identical.
++#!/usr/bin/perl
++#
++# In order for MakeMaker to build in the core, nothing can use Fcntl which
++# includes POSIX. devise_date()'s use of strftime() was replaced. This tests
++# that it's identical. It also tests special handling of the POD_MAN_DATE
++# environment variable.
+
++use 5.006;
+ use strict;
+-
+-use Test::More tests => 1;
++use warnings;
+
+ use Pod::Man;
+ use POSIX qw(strftime);
+
++use Test::More tests => 2;
++
++# Check that the results of device_date matches strftime. There is no input
++# file name, so this will use the current time.
+ my $parser = Pod::Man->new;
+-is $parser->devise_date, strftime("%Y-%m-%d", localtime);
++is(
++ $parser->devise_date,
++ strftime('%Y-%m-%d', localtime()),
++ 'devise_date matches strftime'
++);
++
++# Set the override environment variable and ensure that it's honored.
++local $ENV{POD_MAN_DATE} = '2014-01-01';
++is($parser->devise_date, '2014-01-01', 'devise_date honors POD_MAN_DATE');
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff
new file mode 100644
index 000000000..7ebbf9c60
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff
@@ -0,0 +1,51 @@
+From 183bb4af7ad862a2cf31d0dcb3dd45c100f76776 Mon Sep 17 00:00:00 2001
+From: Russ Allbery <rra@cpan.org>
+Date: Wed, 15 Apr 2015 22:21:25 -0700
+Subject: Support an empty POD_MAN_DATE environment variable
+
+One may want to set this to an empty string. Handle that correctly.
+
+(backported to Perl 5.20.2 by Niko Tyni <ntyni@debian.org>)
+
+Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=e0e9fcb53e8fc954b2b1955385eea18c27f869af
+Bug-Debian: https://bugs.debian.org/780259
+Patch-Name: fixes/podman-empty-date.diff
+---
+ cpan/podlators/lib/Pod/Man.pm | 2 +-
+ cpan/podlators/t/devise-date.t | 6 +++++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index 365892e..8997a15 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -894,7 +894,7 @@ sub devise_date {
+ my ($self) = @_;
+
+ # If POD_MAN_DATE is set, always use it.
+- if ($ENV{POD_MAN_DATE}) {
++ if (defined($ENV{POD_MAN_DATE})) {
+ return $ENV{POD_MAN_DATE};
+ }
+
+diff --git a/cpan/podlators/t/devise-date.t b/cpan/podlators/t/devise-date.t
+index 9da9d1b..27271d9 100644
+--- a/cpan/podlators/t/devise-date.t
++++ b/cpan/podlators/t/devise-date.t
+@@ -12,7 +12,7 @@ use warnings;
+ use Pod::Man;
+ use POSIX qw(strftime);
+
+-use Test::More tests => 2;
++use Test::More tests => 3;
+
+ # Check that the results of device_date matches strftime. There is no input
+ # file name, so this will use the current time.
+@@ -26,3 +26,7 @@ is(
+ # Set the override environment variable and ensure that it's honored.
+ local $ENV{POD_MAN_DATE} = '2014-01-01';
+ is($parser->devise_date, '2014-01-01', 'devise_date honors POD_MAN_DATE');
++
++# Check that an empty environment variable is honored.
++local $ENV{POD_MAN_DATE} = q{};
++is($parser->devise_date, q{}, 'devise_date honors empty POD_MAN_DATE');
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff
new file mode 100644
index 000000000..1a6036116
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff
@@ -0,0 +1,109 @@
+From 7671d101baa75d7a79bfbd8c75c1595fbb3f53ba Mon Sep 17 00:00:00 2001
+From: Russ Allbery <rra@cpan.org>
+Date: Sat, 7 Feb 2015 19:03:34 -0800
+Subject: Better errors for man pages from standard input
+
+[Pod::Man] Attempt to detect if the input came from a pipe and
+therefore has a completely unhelpful (and nonreproducible) source file
+name, and diagnose this as an error. Document that the name option
+(--name to pod2man) is required when processing POD source from
+standard input. (Debian Bug#777405)
+
+(backported to Perl 5.20.2 by Niko Tyni <ntyni@debian.org>)
+
+Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=d98872e46c93861b7aba14949e1258712087dc55
+Bug-Debian: https://bugs.debian.org/777405
+Patch-Name: fixes/podman-pipe.diff
+---
+ cpan/podlators/lib/Pod/Man.pm | 15 +++++++++++++++
+ cpan/podlators/scripts/pod2man.PL | 4 ++++
+ cpan/podlators/t/devise-title.t | 32 ++++++++++++++++++++++++++++++++
+ 3 files changed, 51 insertions(+)
+ create mode 100755 cpan/podlators/t/devise-title.t
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index 8997a15..969eaff 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -828,6 +828,17 @@ sub devise_title {
+ $section = 3 if (!$$self{section} && $name =~ /\.pm\z/i);
+ $name =~ s/\.p(od|[lm])\z//i;
+
++ # If Pod::Parser gave us an IO::File reference as the source file name,
++ # convert that to the empty string as well. Then, if we don't have a
++ # valid name, emit a warning and convert it to STDIN.
++ if ($name =~ /^IO::File(?:=\w+)\(0x[\da-f]+\)$/i) {
++ $name = '';
++ }
++ if ($name eq '') {
++ $self->whine (1, 'No name given for document');
++ $name = 'STDIN';
++ }
++
+ # If the section isn't 3, then the name defaults to just the basename of
+ # the file. Otherwise, assume we're dealing with a module. We want to
+ # figure out the full module name from the path to the file, but we don't
+@@ -1705,6 +1716,10 @@ module path. If it is, a path like C<.../lib/Pod/Man.pm> is converted into
+ a name like C<Pod::Man>. This option, if given, overrides any automatic
+ determination of the name.
+
++If generating a manual page from standard input, this option is required,
++since there's otherwise no way for Pod::Man to know what to use for the
++manual page name.
++
+ =item nourls
+
+ Normally, LZ<><> formatting codes with a URL but anchor text are formatted
+diff --git a/cpan/podlators/scripts/pod2man.PL b/cpan/podlators/scripts/pod2man.PL
+index 38695f8..43e35df 100644
+--- a/cpan/podlators/scripts/pod2man.PL
++++ b/cpan/podlators/scripts/pod2man.PL
+@@ -236,6 +236,10 @@ Note that this option is probably not useful when converting multiple POD
+ files at once. The convention for Unix man pages for commands is for the
+ man page title to be in all-uppercase even if the command isn't.
+
++When converting POD source from standard input, this option is required,
++since there's otherwise no way to know what to use as the name of the
++manual page.
++
+ =item B<--nourls>
+
+ Normally, LZ<><> formatting codes with a URL but anchor text are formatted
+diff --git a/cpan/podlators/t/devise-title.t b/cpan/podlators/t/devise-title.t
+new file mode 100755
+index 0000000..8639441
+--- /dev/null
++++ b/cpan/podlators/t/devise-title.t
+@@ -0,0 +1,32 @@
++#!/usr/bin/perl
++#
++# Tests for the automatic determination of the manual page title if not
++# specified via options to pod2man or the Pod::Man constructor.
++
++use 5.006;
++use strict;
++use warnings;
++
++use File::Spec;
++use IO::File;
++use Test::More tests => 3;
++
++BEGIN {
++ use_ok('Pod::Man');
++}
++
++# Create a parser and set it up with an input source. There isn't a way to do
++# this in Pod::Simple without actually parsing the document, so send the
++# output to a string that we'll ignore.
++my $path = File::Spec->catdir('t', 'data', 'basic.pod');
++my $handle = IO::File->new($path, 'r');
++my $parser = Pod::Man->new(errors => 'pod');
++my $output;
++$parser->output_string(\$output);
++$parser->parse_file($handle);
++
++# Check the results of devise_title for this. We should get back STDIN, and
++# we should have reported an error.
++my ($name, $section) = $parser->devise_title;
++is($name, 'STDIN', 'devise_title uses STDIN for file handle input');
++ok($parser->errors_seen, '...and errors were seen');
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff
new file mode 100644
index 000000000..0cdfeffd1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff
@@ -0,0 +1,86 @@
+From 6198856b5323d6204094293f01b890472618f182 Mon Sep 17 00:00:00 2001
+From: Russ Allbery <rra@cpan.org>
+Date: Wed, 15 Apr 2015 20:49:07 -0700
+Subject: Documentation and test suite updates for UTC fix
+
+Update the Pod::Man and pod2man documentation and the test suite
+for the new UTC-based default page footer, and add a Changes
+entry.
+
+(backported to Perl 5.20.2 by Niko Tyni <ntyni@debian.org>)
+
+Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=52db93bf80e4a06f8497e4ebade0506b6ee0e70d
+Bug-Debian: https://bugs.debian.org/780259
+Patch-Name: fixes/podman-utc-docs.diff
+---
+ cpan/podlators/lib/Pod/Man.pm | 6 +++++-
+ cpan/podlators/scripts/pod2man.PL | 11 ++++++-----
+ cpan/podlators/t/devise-date.t | 2 +-
+ 3 files changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index c3ba201..365892e 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -910,6 +910,8 @@ sub devise_date {
+
+ # Can't use POSIX::strftime(), which uses Fcntl, because MakeMaker uses
+ # this and it has to work in the core which can't load dynamic libraries.
++ # Use gmtime instead of localtime so that the generated man page does not
++ # depend on the local time zone setting and is more reproducible
+ my ($year, $month, $day) = (gmtime($time))[5,4,3];
+ return sprintf("%04d-%02d-%02d", $year + 1900, $month + 1, $day);
+ }
+@@ -1656,7 +1658,9 @@ environment variable POD_MAN_DATE, if set, will be used. Failing that,
+ the modification date of the input file will be used, or the current time
+ if stat() can't find that file (which will be the case if the input is
+ from C<STDIN>). If obtained from the file modification date or the
+-current time, he date will be formatted as C<YYYY-MM-DD>.
++current time, the date will be formatted as C<YYYY-MM-DD> and will be based
++on UTC (so that the output will be reproducible regardless of local time
++zone).
+
+ =item errors
+
+diff --git a/cpan/podlators/scripts/pod2man.PL b/cpan/podlators/scripts/pod2man.PL
+index 6af3474..38695f8 100644
+--- a/cpan/podlators/scripts/pod2man.PL
++++ b/cpan/podlators/scripts/pod2man.PL
+@@ -174,9 +174,10 @@ Contributed Perl Documentation", but also see B<--official> below.
+
+ =item B<-d> I<string>, B<--date>=I<string>
+
+-Set the left-hand footer string to this value. By default, the modification
+-date of the input file will be used, or the current date if input comes from
+-C<STDIN>.
++Set the left-hand footer string to this value. By default, the
++modification date of the input file will be used, or the current date if
++input comes from C<STDIN>, and will be based on UTC (so that the output
++will be reproducible regardless of local time zone).
+
+ =item B<-errors>=I<style>
+
+@@ -383,8 +384,8 @@ B<pod2man> by Larry Wall and Tom Christiansen.
+
+ =head1 COPYRIGHT AND LICENSE
+
+-Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013 Russ
+-Allbery <rra@stanford.edu>.
++Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013, 2014,
++2015 Russ Allbery <rra@cpan.org>.
+
+ This program is free software; you may redistribute it and/or modify it
+ under the same terms as Perl itself.
+diff --git a/cpan/podlators/t/devise-date.t b/cpan/podlators/t/devise-date.t
+index c610dd9..9da9d1b 100644
+--- a/cpan/podlators/t/devise-date.t
++++ b/cpan/podlators/t/devise-date.t
+@@ -19,7 +19,7 @@ use Test::More tests => 2;
+ my $parser = Pod::Man->new;
+ is(
+ $parser->devise_date,
+- strftime('%Y-%m-%d', localtime()),
++ strftime('%Y-%m-%d', gmtime()),
+ 'devise_date matches strftime'
+ );
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff
new file mode 100644
index 000000000..fbd7b9db9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff
@@ -0,0 +1,33 @@
+From c796775cdbd2cce06acbb7ac355187d4063017a2 Mon Sep 17 00:00:00 2001
+From: Chris Lamb <lamby@debian.org>
+Date: Wed, 15 Apr 2015 20:42:53 -0700
+Subject: Make the embedded date from Pod::Man reproducible
+
+While working on the "reproducible builds" effort, we have noticed
+that Pod::Man generates output that varies depending on the current
+timezone.
+
+The attached patch fixes this by using GMT (~UTC) dates instead.
+
+(backported to Perl 5.20.2 by Niko Tyni <ntyni@debian.org>)
+
+Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=913fbb2bd2ce071e20128629302ae2852554cad4
+Bug-Debian: https://bugs.debian.org/780259
+Patch-Name: fixes/podman-utc.diff
+---
+ cpan/podlators/lib/Pod/Man.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index 0536662..c3ba201 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -910,7 +910,7 @@ sub devise_date {
+
+ # Can't use POSIX::strftime(), which uses Fcntl, because MakeMaker uses
+ # this and it has to work in the core which can't load dynamic libraries.
+- my ($year, $month, $day) = (localtime($time))[5,4,3];
++ my ($year, $month, $day) = (gmtime($time))[5,4,3];
+ return sprintf("%04d-%02d-%02d", $year + 1900, $month + 1, $day);
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff
new file mode 100644
index 000000000..d1b498b52
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff
@@ -0,0 +1,153 @@
+From d9d535ef97f57af6e9728075944c33f3b0b5372f Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Respect umask during installation
+
+This is needed to satisfy Debian policy regarding group-writable
+site directories.
+
+Patch-Name: fixes/respect_umask.diff
+---
+ cpan/ExtUtils-Install/lib/ExtUtils/Install.pm | 18 +++++++++---------
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 18 +++++++++---------
+ 2 files changed, 18 insertions(+), 18 deletions(-)
+
+diff --git a/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm b/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
+index 1e8ac4c..3e79121 100644
+--- a/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
++++ b/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
+@@ -451,7 +451,7 @@ sub _can_write_dir {
+
+ =pod
+
+-=item _mkpath($dir,$show,$mode,$verbose,$dry_run)
++=item _mkpath($dir,$show,$verbose,$dry_run)
+
+ Wrapper around File::Path::mkpath() to handle errors.
+
+@@ -468,13 +468,13 @@ writable.
+ =cut
+
+ sub _mkpath {
+- my ($dir,$show,$mode,$verbose,$dry_run)=@_;
++ my ($dir,$show,$verbose,$dry_run)=@_;
+ if ( $verbose && $verbose > 1 && ! -d $dir) {
+ $show= 1;
+- printf "mkpath(%s,%d,%#o)\n", $dir, $show, $mode;
++ printf "mkpath(%s,%d)\n", $dir, $show;
+ }
+ if (!$dry_run) {
+- if ( ! eval { File::Path::mkpath($dir,$show,$mode); 1 } ) {
++ if ( ! eval { File::Path::mkpath($dir,$show); 1 } ) {
+ _choke("Can't create '$dir'","$@");
+ }
+
+@@ -783,7 +783,7 @@ sub install { #XXX OS-SPECIFIC
+ _chdir($cwd);
+ }
+ foreach my $targetdir (sort keys %check_dirs) {
+- _mkpath( $targetdir, 0, 0755, $verbose, $dry_run );
++ _mkpath( $targetdir, 0, $verbose, $dry_run );
+ }
+ foreach my $found (@found_files) {
+ my ($diff, $ffd, $origfile, $mode, $size, $atime, $mtime,
+@@ -797,7 +797,7 @@ sub install { #XXX OS-SPECIFIC
+ $targetfile= _unlink_or_rename( $targetfile, 'tryhard', 'install' )
+ unless $dry_run;
+ } elsif ( ! -d $targetdir ) {
+- _mkpath( $targetdir, 0, 0755, $verbose, $dry_run );
++ _mkpath( $targetdir, 0, $verbose, $dry_run );
+ }
+ print "Installing $targetfile\n";
+
+@@ -837,7 +837,7 @@ sub install { #XXX OS-SPECIFIC
+
+ if ($pack{'write'}) {
+ $dir = install_rooted_dir(dirname($pack{'write'}));
+- _mkpath( $dir, 0, 0755, $verbose, $dry_run );
++ _mkpath( $dir, 0, $verbose, $dry_run );
+ print "Writing $pack{'write'}\n" if $verbose;
+ $packlist->write(install_rooted_file($pack{'write'})) unless $dry_run;
+ }
+@@ -1180,7 +1180,7 @@ environment variable will silence this output.
+ sub pm_to_blib {
+ my($fromto,$autodir,$pm_filter) = @_;
+
+- _mkpath($autodir,0,0755);
++ _mkpath($autodir,0);
+ while(my($from, $to) = each %$fromto) {
+ if( -f $to && -s $from == -s $to && -M $to < -M $from ) {
+ print "Skip $to (unchanged)\n" unless $INSTALL_QUIET;
+@@ -1203,7 +1203,7 @@ sub pm_to_blib {
+ # we wont try hard here. its too likely to mess things up.
+ forceunlink($to);
+ } else {
+- _mkpath(dirname($to),0,0755);
++ _mkpath(dirname($to),0);
+ }
+ if ($need_filtering) {
+ run_filter($pm_filter, $from, $to);
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index f63145c..197f102 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2118,7 +2118,7 @@ doc__install : doc_site_install
+ $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
+
+ pure_perl_install :: all
+- $(NOECHO) $(MOD_INSTALL) \
++ $(NOECHO) umask 022; $(MOD_INSTALL) \
+ };
+
+ push @m,
+@@ -2138,7 +2138,7 @@ q{ "$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
+
+
+ pure_site_install :: all
+- $(NOECHO) $(MOD_INSTALL) \
++ $(NOECHO) umask 022; $(MOD_INSTALL) \
+ };
+ push @m,
+ q{ read "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+@@ -2156,7 +2156,7 @@ q{ "$(INST_LIB)" "$(DESTINSTALLSITELIB)" \
+ "}.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{"
+
+ pure_vendor_install :: all
+- $(NOECHO) $(MOD_INSTALL) \
++ $(NOECHO) umask 022; $(MOD_INSTALL) \
+ };
+ push @m,
+ q{ read "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+@@ -2188,8 +2188,8 @@ doc_vendor_install :: all
+ push @m, q{
+ doc_perl_install :: all
+ $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) $(DOC_INSTALL) \
++ -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++ -$(NOECHO) umask 022; $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" $(INSTALLPRIVLIB) \
+ LINKTYPE "$(LINKTYPE)" \
+@@ -2199,8 +2199,8 @@ doc_perl_install :: all
+
+ doc_site_install :: all
+ $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) $(DOC_INSTALL) \
++ -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++ -$(NOECHO) umask 022; $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" $(INSTALLSITELIB) \
+ LINKTYPE "$(LINKTYPE)" \
+@@ -2210,8 +2210,8 @@ doc_site_install :: all
+
+ doc_vendor_install :: all
+ $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) $(DOC_INSTALL) \
++ -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++ -$(NOECHO) umask 022; $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" $(INSTALLVENDORLIB) \
+ LINKTYPE "$(LINKTYPE)" \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff
new file mode 100644
index 000000000..a62c746e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff
@@ -0,0 +1,27 @@
+From 26209b55201a1b2d25252ac3b425bc49081299de Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Debian policy doesn't install .packlist files for core or vendor.
+
+Patch-Name: debian/instmodsh_doc.diff
+---
+ cpan/ExtUtils-MakeMaker/bin/instmodsh | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/bin/instmodsh b/cpan/ExtUtils-MakeMaker/bin/instmodsh
+index 8b9aa95..e551434 100644
+--- a/cpan/ExtUtils-MakeMaker/bin/instmodsh
++++ b/cpan/ExtUtils-MakeMaker/bin/instmodsh
+@@ -18,9 +18,11 @@ instmodsh - A shell to examine installed modules
+
+ =head1 DESCRIPTION
+
+-A little interface to ExtUtils::Installed to examine installed modules,
++A little interface to ExtUtils::Installed to examine locally* installed modules,
+ validate your packlists and even create a tarball from an installed module.
+
++*On Debian system, B<core> and B<vendor> modules are managed by C<dpkg>.
++
+ =head1 SEE ALSO
+
+ ExtUtils::Installed
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff
new file mode 100644
index 000000000..d80f86c21
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff
@@ -0,0 +1,24 @@
+From 53ce69085918232a1b7e26e7762c1b2f70b1eb4a Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: Remove standard libs from LD_RUN_PATH as per Debian policy.
+
+Patch-Name: debian/ld_run_path.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+index 37bcfd4..bd66e65 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+@@ -56,6 +56,9 @@ sub _unix_os2_ext {
+ my ( $pwd ) = cwd(); # from Cwd.pm
+ my ( $found ) = 0;
+
++ # Debian-specific: don't use LD_RUN_PATH for standard dirs
++ $ld_run_path_seen{$_}++ for @libpath;
++
+ foreach my $thislib ( split ' ', $potential_libs ) {
+ my ( $custom_name ) = '';
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff
new file mode 100644
index 000000000..54ef9640e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff
@@ -0,0 +1,37 @@
+From a7f6d453e60256d329469a75b642cca854cebea1 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Set location of libnet.cfg to /etc/perl/Net as /usr may not be
+ writable.
+
+Patch-Name: debian/libnet_config_path.diff
+---
+ cpan/libnet/lib/Net/Config.pm | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/cpan/libnet/lib/Net/Config.pm b/cpan/libnet/lib/Net/Config.pm
+index 953a826..61ba12a 100644
+--- a/cpan/libnet/lib/Net/Config.pm
++++ b/cpan/libnet/lib/Net/Config.pm
+@@ -68,9 +68,8 @@ my %nc = (
+ TRY_INTERNET_CONFIG
+ }
+
+-my $file = __FILE__;
++my $file = '/etc/perl/Net/libnet.cfg';
+ my $ref;
+-$file =~ s/Config.pm/libnet.cfg/;
+ if (-f $file) {
+ $ref = eval { local $SIG{__DIE__}; do $file };
+ if (ref($ref) eq 'HASH') {
+@@ -142,8 +141,8 @@ Net::Config - Local configuration data for libnet
+ C<Net::Config> holds configuration data for the modules in the libnet
+ distribution. During installation you will be asked for these values.
+
+-The configuration data is held globally in a file in the perl installation
+-tree, but a user may override any of these values by providing their own. This
++The configuration data is held globally in C</etc/perl/Net/libnet.cfg>,
++but a user may override any of these values by providing their own. This
+ can be done by having a C<.libnetrc> file in their home directory. This file
+ should return a reference to a HASH containing the keys described below.
+ For example
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff
new file mode 100644
index 000000000..76b805451
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff
@@ -0,0 +1,26 @@
+From fb8bdbb4bf56382de099e62c2564286b9dfda46d Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Note that libperl-dev package is required for embedded linking
+
+Bug-Debian: http://bugs.debian.org/186778
+
+Patch-Name: debian/libperl_embed_doc.diff
+---
+ lib/ExtUtils/Embed.pm | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/lib/ExtUtils/Embed.pm b/lib/ExtUtils/Embed.pm
+index 3f983c1..0ec8a67 100644
+--- a/lib/ExtUtils/Embed.pm
++++ b/lib/ExtUtils/Embed.pm
+@@ -296,6 +296,9 @@ and extensions in your C/C++ applications.
+ Typically, an application F<Makefile> will invoke C<ExtUtils::Embed>
+ functions while building your application.
+
++Note that on Debian systems the B<libperl-dev> package is required for
++compiling applications which embed an interpreter.
++
+ =head1 @EXPORT
+
+ C<ExtUtils::Embed> exports the following functions:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff
new file mode 100644
index 000000000..fd471ed7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff
@@ -0,0 +1,52 @@
+From 289eaf87f8de4d9ebfd661d4e4299c2952435243 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Fri, 10 Apr 2015 10:19:51 +0300
+Subject: Make t/run/locale.t survive missing locales masked by LC_ALL
+
+If LC_ALL is set to a valid locale but another LC_* setting like LC_CTYPE
+isn't, t/run/locale.t would fail because it explicitly unsets LC_ALL,
+unmasking the problem underneath. All the other tests survive such
+a scenario.
+
+While this is clearly an error in the build environment, it's easy to make
+the test more robust by first clearing all the locale relevant variables.
+
+Bug: https://rt.perl.org/Ticket/Display.html?id=124310
+Bug-Debian: https://bugs.debian.org/782068
+Patch-Name: debian/locale-robustness.diff
+---
+ t/run/locale.t | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/t/run/locale.t b/t/run/locale.t
+index bd1a034..2105339 100644
+--- a/t/run/locale.t
++++ b/t/run/locale.t
+@@ -27,6 +27,9 @@ my @locales = eval { find_locales( [ &LC_ALL, &LC_CTYPE, &LC_NUMERIC ],
+ ) };
+ skip_all("no locales available") unless @locales;
+
++# reset the locale environment
++local @ENV{'LANG', (grep /^LC_/, keys %ENV)};
++
+ plan tests => &last;
+
+ my $non_C_locale;
+@@ -58,9 +61,6 @@ EOF
+ SKIP: {
+ skip("Windows stores locale defaults in the registry", 1 )
+ if $^O eq 'MSWin32';
+- local $ENV{LC_NUMERIC}; # So not taken as a default
+- local $ENV{LC_ALL}; # so it never overrides LC_NUMERIC
+- local $ENV{LANG}; # So not taken as a default
+ fresh_perl_is("for (qw(@locales)) {\n" . <<'EOF',
+ use POSIX qw(locale_h);
+ use locale;
+@@ -348,7 +348,6 @@ EOF
+
+ {
+ local $ENV{LC_NUMERIC} = $different;
+- local $ENV{LC_ALL}; # so it never overrides LC_NUMERIC
+ fresh_perl_is(<<"EOF",
+ use POSIX qw(locale_h);
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff
new file mode 100644
index 000000000..fa0f9daf9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff
@@ -0,0 +1,30 @@
+From 593dd52f535b1f439dfd0afe52211ae8960e980a Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sun, 24 Aug 2014 12:56:11 -0700
+Subject: Pass LD settings through to subdirectories
+
+[rt.cpan.org #28632] fixed most issues with passing LD down to
+subdirectory Makefile.PL files. However, there are some distributions
+(including Wx, Par::Packer, and Verilog-Perl) that explicitly set
+LD. Those still can't be overridden from the command line. Adding LD to
+the PASTHRU list fixes this.
+
+Bug-Debian: https://bugs.debian.org/758471
+Patch-Name: debian/makemaker-pasthru.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 4a8e14c..548d98e 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2793,7 +2793,7 @@ sub pasthru {
+ my($sep) = $Is{VMS} ? ',' : '';
+ $sep .= "\\\n\t";
+
+- foreach my $key (qw(LIB LIBPERL_A LINKTYPE OPTIMIZE
++ foreach my $key (qw(LIB LIBPERL_A LINKTYPE OPTIMIZE LD
+ PREFIX INSTALL_BASE)
+ )
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff
new file mode 100644
index 000000000..b1b4cb9a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff
@@ -0,0 +1,42 @@
+From 634449066a9c810e81506425d2ca925b2fd72ab2 Mon Sep 17 00:00:00 2001
+From: Dominic Hargreaves <dom@earth.li>
+Date: Sat, 23 May 2015 21:15:06 +0200
+Subject: Update t/porting/customized.dat for files patched in Debian
+
+Patch-Name: debian/makemaker_customized.diff
+---
+ t/porting/customized.dat | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/t/porting/customized.dat b/t/porting/customized.dat
+index 7df398d..f857bd2 100644
+--- a/t/porting/customized.dat
++++ b/t/porting/customized.dat
+@@ -1,7 +1,7 @@
+ 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 3493ae6f93264e967f58dedaa3dbf3dbcb249853
++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
+@@ -13,7 +13,7 @@ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mkbootstrap.pm 58872d66
+ 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
+@@ -22,7 +22,7 @@ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_MacOS.pm 0544301f712
+ 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 c455c915fb7dc3eeb1200ed1cd19048e6f21e6b1
+ 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
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/mod_paths.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/mod_paths.diff
new file mode 100644
index 000000000..ae1590760
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/mod_paths.diff
@@ -0,0 +1,99 @@
+From 6c6cf14e204f3c031372bfd9604ad524d5691186 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: Tweak @INC ordering for Debian
+
+Our order is:
+
+ etc (for config files)
+ site (5.8.1)
+ vendor (all)
+ core (5.8.1)
+ site (version-indep)
+ site (pre-5.8.1)
+
+The rationale being that an admin (via site), or module packager
+(vendor) can chose to shadow core modules when there is a newer
+version than is included in core.
+
+Patch-Name: debian/mod_paths.diff
+---
+ perl.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 58 insertions(+)
+
+diff --git a/perl.c b/perl.c
+index 086645b..e64f1f4 100644
+--- a/perl.c
++++ b/perl.c
+@@ -4373,6 +4373,11 @@ S_init_perllib(pTHX)
+ INCPUSH_ADD_SUB_DIRS|INCPUSH_CAN_RELOCATE);
+ #endif
+
++#ifdef DEBIAN
++ /* for configuration where /usr is mounted ro (CPAN::Config, Net::Config) */
++ S_incpush_use_sep(aTHX_ STR_WITH_LEN("/etc/perl"), 0x0);
++#endif
++
+ #ifdef SITEARCH_EXP
+ /* sitearch is always relative to sitelib on Windows for
+ * DLL-based path intuition to work correctly */
+@@ -4490,6 +4495,59 @@ S_init_perllib(pTHX)
+ INCPUSH_ADD_OLD_VERS|INCPUSH_CAN_RELOCATE);
+ #endif
+
++#ifdef DEBIAN
++ /* Non-versioned site directory for local modules and for
++ compatability with the previous packages' site dirs */
++ S_incpush_use_sep(aTHX_ STR_WITH_LEN("/usr/local/lib/site_perl"),
++ INCPUSH_ADD_SUB_DIRS);
++
++#ifdef PERL_INC_VERSION_LIST
++ {
++ struct stat s;
++
++ /* add small buffer in case old versions are longer than the
++ current version */
++ char sitearch[sizeof(SITEARCH_EXP)+16] = SITEARCH_EXP;
++ char sitelib[sizeof(SITELIB_EXP)+16] = SITELIB_EXP;
++ char const *vers[] = { PERL_INC_VERSION_LIST };
++ char const **p;
++
++ char *arch_vers = strrchr(sitearch, '/');
++ char *lib_vers = strrchr(sitelib, '/');
++
++ if (arch_vers && isdigit(*++arch_vers))
++ *arch_vers = 0;
++ else
++ arch_vers = 0;
++
++ if (lib_vers && isdigit(*++lib_vers))
++ *lib_vers = 0;
++ else
++ lib_vers = 0;
++
++ /* there is some duplication here as incpush does something
++ similar internally, but required as sitearch is not a
++ subdirectory of sitelib */
++ for (p = vers; *p; p++)
++ {
++ if (arch_vers)
++ {
++ strcpy(arch_vers, *p);
++ if (PerlLIO_stat(sitearch, &s) >= 0 && S_ISDIR(s.st_mode))
++ S_incpush_use_sep(aTHX_ sitearch, strlen(sitearch), 0x0);
++ }
++
++ if (lib_vers)
++ {
++ strcpy(lib_vers, *p);
++ if (PerlLIO_stat(sitelib, &s) >= 0 && S_ISDIR(s.st_mode))
++ S_incpush_use_sep(aTHX_ sitelib, strlen(sitelib), 0x0);
++ }
++ }
++ }
++#endif
++#endif
++
+ #ifdef PERL_OTHERLIBDIRS
+ S_incpush_use_sep(aTHX_ STR_WITH_LEN(PERL_OTHERLIBDIRS),
+ INCPUSH_ADD_OLD_VERS|INCPUSH_ADD_ARCHONLY_SUB_DIRS
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff
new file mode 100644
index 000000000..b911fd276
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff
@@ -0,0 +1,92 @@
+From 240f2f4aeb3850bc0c5370b9fbc3909573bed9b3 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Don't install .packlist or perllocal.pod for perl or vendor
+
+Patch-Name: debian/no_packlist_perllocal.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 35 +++----------------------
+ 1 file changed, 3 insertions(+), 32 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 570a631..391dc22 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2122,11 +2122,6 @@ pure_perl_install :: all
+ };
+
+ push @m,
+-q{ read "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
+- write "}.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
+-} unless $self->{NO_PACKLIST};
+-
+- push @m,
+ q{ "$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
+ "$(INST_ARCHLIB)" "$(DESTINSTALLARCHLIB)" \
+ "$(INST_BIN)" "$(DESTINSTALLBIN)" \
+@@ -2158,10 +2153,6 @@ q{ "$(INST_LIB)" "$(DESTINSTALLSITELIB)" \
+ pure_vendor_install :: all
+ $(NOECHO) umask 022; $(MOD_INSTALL) \
+ };
+- push @m,
+-q{ read "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+- write "}.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{" \
+-} unless $self->{NO_PACKLIST};
+
+ push @m,
+ q{ "$(INST_LIB)" "$(DESTINSTALLVENDORLIB)" \
+@@ -2187,37 +2178,19 @@ doc_vendor_install :: all
+
+ push @m, q{
+ doc_perl_install :: all
+- $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) umask 022; $(DOC_INSTALL) \
+- "Module" "$(NAME)" \
+- "installed into" $(INSTALLPRIVLIB) \
+- LINKTYPE "$(LINKTYPE)" \
+- VERSION "$(VERSION)" \
+- EXE_FILES "$(EXE_FILES)" \
+- >> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
+
+ doc_site_install :: all
+- $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) umask 02; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++ $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLSITEARCH)/perllocal.pod"
++ -$(NOECHO) umask 02; $(MKPATH) "$(DESTINSTALLSITEARCH)"
+ -$(NOECHO) umask 02; $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" $(INSTALLSITELIB) \
+ LINKTYPE "$(LINKTYPE)" \
+ VERSION "$(VERSION)" \
+ EXE_FILES "$(EXE_FILES)" \
+- >> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
++ >> "}.$self->catfile('$(DESTINSTALLSITEARCH)','perllocal.pod').q{"
+
+ doc_vendor_install :: all
+- $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) umask 022; $(DOC_INSTALL) \
+- "Module" "$(NAME)" \
+- "installed into" $(INSTALLVENDORLIB) \
+- LINKTYPE "$(LINKTYPE)" \
+- VERSION "$(VERSION)" \
+- EXE_FILES "$(EXE_FILES)" \
+- >> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
+
+ } unless $self->{NO_PERLLOCAL};
+
+@@ -2226,13 +2199,11 @@ uninstall :: uninstall_from_$(INSTALLDIRS)dirs
+ $(NOECHO) $(NOOP)
+
+ uninstall_from_perldirs ::
+- $(NOECHO) $(UNINSTALL) "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{"
+
+ uninstall_from_sitedirs ::
+ $(NOECHO) $(UNINSTALL) "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
+
+ uninstall_from_vendordirs ::
+- $(NOECHO) $(UNINSTALL) "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
+ };
+
+ join("",@m);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/patchlevel.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/patchlevel.diff
new file mode 100644
index 000000000..8656b027e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/patchlevel.diff
@@ -0,0 +1,30 @@
+From b517c5e15d0871e36d0f1187661fe1dd28ddf820 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sun, 15 May 2011 19:35:58 +0300
+Subject: List packaged patches in patchlevel.h
+
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/567489
+
+The list of packaged patches is in patchlevel-debian.h, which is generated
+from the debian/patches/ directory when building the package.
+
+Patch-Name: debian/patchlevel.diff
+---
+ patchlevel.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/patchlevel.h b/patchlevel.h
+index a0ad78b..01367b7 100644
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -137,6 +137,9 @@ static const char * const local_patches[] = {
+ ,"uncommitted-changes"
+ #endif
+ PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */
++#ifdef DEBIAN
++#include "patchlevel-debian.h"
++#endif
+ ,NULL
+ };
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch
new file mode 100644
index 000000000..533952cac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch
@@ -0,0 +1,29 @@
+From c99c61e8f863a508a0793168011c98dc74abbd05 Mon Sep 17 00:00:00 2001
+From: Dominic Hargreaves <dom@earth.li>
+Date: Sat, 14 Apr 2012 11:34:05 +0100
+Subject: Invoke x-terminal-emulator rather than xterm in perl5db.pl
+
+In Debian systems, xterm might not exist or might not be the preferred
+terminal emulator. Use x-terminal-emulator instead
+
+Bug-Debian: http://bugs.debian.org/668490
+Forwarded: not-needed
+
+Patch-Name: debian/perl5db-x-terminal-emulator.patch
+---
+ lib/perl5db.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/perl5db.pl b/lib/perl5db.pl
+index 7e7194e..c466bf3 100644
+--- a/lib/perl5db.pl
++++ b/lib/perl5db.pl
+@@ -6960,7 +6960,7 @@ properly set up.
+ sub xterm_get_fork_TTY {
+ ( my $name = $0 ) =~ s,^.*[/\\],,s;
+ open XT,
+-qq[3>&1 xterm -title "Daughter Perl debugger $pids $name" -e sh -c 'tty 1>&3;\
++qq[3>&1 x-terminal-emulator -T "Daughter Perl debugger $pids $name" -e sh -c 'tty 1>&3;\
+ sleep 10000000' |];
+
+ # Get the output from 'tty' and clean it up a little.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perlivp.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perlivp.diff
new file mode 100644
index 000000000..2c1eab970
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/perlivp.diff
@@ -0,0 +1,39 @@
+From fbfbeb7a690d703a3cdc56f923e89eb7b7997d31 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Fri, 9 Jan 2009 18:54:47 +0200
+Subject: Make perlivp skip include directories in /usr/local
+
+Bug-Debian: http://bugs.debian.org/510895
+
+On Sat, Jan 10, 2009 at 12:37:18AM +1100, Brendan O'Dea wrote:
+> On Wed, Jan 7, 2009 at 12:21 AM, Niko Tyni <ntyni@debian.org> wrote:
+
+> > We could create the directories in a postinst script, but I'm not sure
+> > I see the point. They will be created automatically when installing
+> > CPAN modules.
+>
+> The directories are intentionally not created, as this way they are
+> excluded from the search path at start-up, saving a bunch of wasted
+> stats at use/require time in the common case that the user has not
+> installed any local packages. As Niko points out, they will be
+> created as required.
+
+Signed-off-by: Niko Tyni <ntyni@debian.org>
+
+Patch-Name: debian/perlivp.diff
+---
+ utils/perlivp.PL | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/utils/perlivp.PL b/utils/perlivp.PL
+index c2f0a11..cc49f96 100644
+--- a/utils/perlivp.PL
++++ b/utils/perlivp.PL
+@@ -153,6 +153,7 @@ my $INC_total = 0;
+ my $INC_there = 0;
+ foreach (@INC) {
+ next if $_ eq '.'; # skip -d test here
++ next if m|/usr/local|; # not shipped on Debian
+ if (-d $_) {
+ print "## Perl \@INC directory '$_' exists.\n" if $opt{'v'};
+ $INC_there++;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff
new file mode 100644
index 000000000..6270b8731
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff
@@ -0,0 +1,23 @@
+From 27a4952c2e531947dc9f2f02e2063d117e2e699a Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sat, 18 Apr 2015 17:39:32 +0300
+Subject: Update porting/customized.dat for pod2man modifications
+
+Patch-Name: debian/pod2man-customized.diff
+---
+ t/porting/customized.dat | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/t/porting/customized.dat b/t/porting/customized.dat
+index 0eed9f7..7df398d 100644
+--- a/t/porting/customized.dat
++++ b/t/porting/customized.dat
+@@ -42,7 +42,7 @@ Win32API::File cpan/Win32API-File/Makefile.PL 605d0aee31aebe84a99408f9ab5f644db5
+ Win32API::File cpan/Win32API-File/t/file.t 124e64aa77e755235eb297644a87fac5388d3d78
+ Win32API::File cpan/Win32API-File/t/tie.t 712ea7edd0cc805ce1c0b8172c01b03dd19b583d
+ Win32API::File cpan/Win32API-File/typemap 24bff088babeadac0873e8df390d1666d9d9db4a
+-podlators cpan/podlators/scripts/pod2man.PL f81acf53f3ff46cdcc5ebdd661c5d13eb35d20d6
++podlators cpan/podlators/scripts/pod2man.PL 761f35d3fcf91c1bc2f9e024a9fa5c62fd3fc338
+ podlators cpan/podlators/scripts/pod2text.PL b4693fcfe4a0a1b38a215cfb8985a65d5d025d69
+ version cpan/version/lib/version.pm d0923b895d57f1d669ae36fcf85c87b16db341d1
+ version vutil.c 668f17ca43e2527645674d29ba772b86330d5663
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff
new file mode 100644
index 000000000..c41efbe3e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff
@@ -0,0 +1,118 @@
+From 914948f026efce02cf0abff8b0312aaad96592ed Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Fiddle with *PREFIX and variables written to the makefile
+
+Fiddle with *PREFIX and variables written to the makefile so that
+install directories may be changed when make is run by passing
+PREFIX= to the "make install" command (used when packaging
+modules).
+
+Patch-Name: debian/prefix_changes.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm | 12 ++++++------
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 3 +--
+ cpan/ExtUtils-MakeMaker/t/INST.t | 4 +---
+ cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t | 10 +++++-----
+ 4 files changed, 13 insertions(+), 16 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
+index 4c00129..1ea2035 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
+@@ -902,8 +902,6 @@ all POD files in MAN1PODS and MAN3PODS.
+ sub manifypods_target {
+ my($self) = shift;
+
+- my $man1pods = '';
+- my $man3pods = '';
+ my $dependencies = '';
+
+ # populate manXpods & dependencies:
+@@ -919,7 +917,7 @@ END
+ foreach my $section (qw(1 3)) {
+ my $pods = $self->{"MAN${section}PODS"};
+ my $p2m = sprintf <<CMD, $] > 5.008 ? " -u" : "";
+- \$(NOECHO) \$(POD2MAN) --section=$section --perm_rw=\$(PERM_RW)%s
++ \$(NOECHO) \$(POD2MAN) --section=\$(MAN${section}EXT) --perm_rw=\$(PERM_RW)%s
+ CMD
+ push @man_cmds, $self->split_command($p2m, map {($_,$pods->{$_})} sort keys %$pods);
+ }
+@@ -1875,9 +1873,11 @@ sub init_INSTALL_from_PREFIX {
+ $self->{SITEPREFIX} ||= $sprefix;
+ $self->{VENDORPREFIX} ||= $vprefix;
+
+- # Lots of MM extension authors like to use $(PREFIX) so we
+- # put something sensible in there no matter what.
+- $self->{PREFIX} = '$('.uc $self->{INSTALLDIRS}.'PREFIX)';
++ my $p = $self->{PREFIX} = $self->{PERLPREFIX};
++ for my $t (qw/PERL SITE VENDOR/)
++ {
++ $self->{"${t}PREFIX"} =~ s!^\Q$p\E(?=/|$)!\$(PREFIX)!;
++ }
+ }
+
+ my $arch = $Config{archname};
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 391dc22..4a8e14c 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -3077,8 +3077,7 @@ sub prefixify {
+ warn " prefixify $var => $path\n" if $Verbose >= 2;
+ warn " from $sprefix to $rprefix\n" if $Verbose >= 2;
+
+- if( $self->{ARGS}{PREFIX} &&
+- $path !~ s{^\Q$sprefix\E\b}{$rprefix}s )
++ if( $path !~ s{^\Q$sprefix\E\b}{$rprefix}s && $self->{ARGS}{PREFIX} )
+ {
+
+ warn " cannot prefix, using default.\n" if $Verbose >= 2;
+diff --git a/cpan/ExtUtils-MakeMaker/t/INST.t b/cpan/ExtUtils-MakeMaker/t/INST.t
+index 91058bb..e399ced 100644
+--- a/cpan/ExtUtils-MakeMaker/t/INST.t
++++ b/cpan/ExtUtils-MakeMaker/t/INST.t
+@@ -65,9 +65,7 @@ isa_ok( $mm, 'ExtUtils::MakeMaker' );
+ is( $mm->{NAME}, 'Big::Dummy', 'NAME' );
+ is( $mm->{VERSION}, 0.01, 'VERSION' );
+
+-my $config_prefix = $Config{installprefixexp} || $Config{installprefix} ||
+- $Config{prefixexp} || $Config{prefix};
+-is( $mm->{PERLPREFIX}, $config_prefix, 'PERLPREFIX' );
++is( $mm->{PERLPREFIX}, '$(PREFIX)', 'PERLPREFIX' );
+
+ is( !!$mm->{PERL_CORE}, !!$ENV{PERL_CORE}, 'PERL_CORE' );
+
+diff --git a/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t b/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
+index e8de7c6..3fb3f12 100644
+--- a/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
++++ b/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
+@@ -10,7 +10,7 @@ BEGIN {
+ }
+
+ use strict;
+-use Test::More tests => 52;
++use Test::More tests => 47;
+ use MakeMaker::Test::Utils;
+ use MakeMaker::Test::Setup::BFD;
+ use ExtUtils::MakeMaker;
+@@ -62,16 +62,16 @@ like( $stdout->read, qr{
+ (?:Writing\ MYMETA.yml\ and\ MYMETA.json\n)?
+ }x );
+
+-is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' );
++#is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' );
+
+ isa_ok( $mm, 'ExtUtils::MakeMaker' );
+
+ is( $mm->{NAME}, 'Big::Dummy', 'NAME' );
+ is( $mm->{VERSION}, 0.01, 'VERSION' );
+
+-foreach my $prefix (qw(PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX)) {
+- unlike( $mm->{$prefix}, qr/\$\(PREFIX\)/ );
+-}
++#foreach my $prefix (qw(PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX)) {
++# unlike( $mm->{$prefix}, qr/\$\(PREFIX\)/ );
++#}
+
+
+ my $PREFIX = File::Spec->catdir('foo', 'bar');
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
new file mode 100644
index 000000000..b4443f647
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff
@@ -0,0 +1,38 @@
+From 21bc033755f0b609f9bb2aa9e98b10d58424406f 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.
+
+Bug-Debian: http://bugs.debian.org/128355
+
+We want to keep the dependencies on perl-base as small as possible,
+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
+--- a/Configure
++++ b/Configure
+@@ -1454,8 +1454,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="$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*)
+ ;;
+ *) case "$usedl" in
+ $define|true|[yY]*)
+- set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
++ set X `echo " $libs " | sed -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldb @ @'`
+ shift
+ perllibs="$*"
+ ;;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/regen-skip.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/regen-skip.diff
new file mode 100644
index 000000000..8a3fc9912
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/regen-skip.diff
@@ -0,0 +1,27 @@
+From cb3e98e17a666896150b109694e9eb9278620845 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sat, 17 May 2014 14:57:01 +0300
+Subject: Skip a regeneration check in unrelated git repositories
+
+If the test is run in a git repository without lib/.gitignore,
+for instance because the repository only imported the Perl tarball,
+the regeneration check is broken because lib/.gitignore is missing.
+
+Patch-Name: debian/regen-skip.diff
+---
+ regen/lib_cleanup.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/regen/lib_cleanup.pl b/regen/lib_cleanup.pl
+index c9d6e43..fece1ed 100644
+--- a/regen/lib_cleanup.pl
++++ b/regen/lib_cleanup.pl
+@@ -159,7 +159,7 @@ foreach ('win32/Makefile', 'win32/makefile.mk') {
+ }
+
+ # This must come last as it can exit early:
+-if ($TAP && !-d '.git' && !-f 'lib/.gitignore') {
++if ($TAP && !-d '.git' || !-f 'lib/.gitignore') {
+ print "ok # skip not being run from a git checkout, hence no lib/.gitignore\n";
+ exit 0;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff
new file mode 100644
index 000000000..ecfc0bc62
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff
@@ -0,0 +1,40 @@
+From 42853af65a28066b119d23d96e964e94b55a8541 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Fri, 5 Aug 2011 10:50:18 +0300
+Subject: Skip a crashing test case in t/op/threads.t on GNU/kFreeBSD
+
+Bug: http://rt.perl.org/rt3/Ticket/Display.html?id=96272
+Bug-Debian: http://bugs.debian.org/628493
+
+The crash is not a regression in 5.14, it just gets triggered there by
+a new unrelated test case.
+
+Skip the test until the culprit is found.
+
+Patch-Name: debian/skip-kfreebsd-crash.diff
+---
+ t/op/threads.t | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/t/op/threads.t b/t/op/threads.t
+index e76c956..bec210b 100644
+--- a/t/op/threads.t
++++ b/t/op/threads.t
+@@ -376,6 +376,9 @@ EOF
+ }
+
+
++SKIP: {
++ skip "[perl #96272] avoid crash on GNU/kFreeBSD", 1
++ if $^O eq 'gnukfreebsd';
+ # [perl #78494] Pipes shared between threads block when closed
+ {
+ my $perl = which_perl;
+@@ -384,6 +387,7 @@ EOF
+ threads->create(sub { })->join;
+ ok(1, "Pipes shared between threads do not block when closed");
+ }
++}
+
+ # [perl #105208] Typeglob clones should not be cloned again during a join
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff
new file mode 100644
index 000000000..4c87104cc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff
@@ -0,0 +1,28 @@
+From ae9b645d6da2990fd055368eca2c67c449474e38 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Fri, 22 Apr 2011 11:15:32 +0300
+Subject: Skip tests specific to the upstream Git repository
+
+These tests fail if run from a different git repository than
+upstream. This complicates things needlessly for downstream packagers.
+
+Skip the tests altogether even if the .git directory exists.
+
+Patch-Name: debian/skip-upstream-git-tests.diff
+---
+ t/test.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/t/test.pl b/t/test.pl
+index cda3840..af579a2 100644
+--- a/t/test.pl
++++ b/t/test.pl
+@@ -174,7 +174,7 @@ sub skip_all_without_unicode_tables { # (but only under miniperl)
+
+ sub find_git_or_skip {
+ my ($source_dir, $reason);
+- if (-d '.git') {
++ if (-d '.git' && ! -d 'debian') {
+ $source_dir = '.';
+ } elsif (-l 'MANIFEST' && -l 'AUTHORS') {
+ my $where = readlink 'MANIFEST';
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff
new file mode 100644
index 000000000..cb3145776
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff
@@ -0,0 +1,56 @@
+From 487a6d6ada0b08e6a7276520ebc61cd851005e7c Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sun, 3 Oct 2010 21:36:17 +0300
+Subject: Squelch locale warnings in Debian package maintainer scripts
+
+Bug-Debian: http://bugs.debian.org/508764
+
+The system locales are rather frequently out of sync with the C library
+during package upgrades, causing a huge amount of useless Perl locale
+warnings. Squelch them when running package maintainer scripts, detected
+by the DPKG_RUNNING_VERSION environment variable.
+
+Any real locale problem will show up after the system upgrade too, and
+the warning will be triggered normally again at that point.
+
+Patch-Name: debian/squelch-locale-warnings.diff
+---
+ locale.c | 5 ++++-
+ pod/perllocale.pod | 8 ++++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/locale.c b/locale.c
+index 7a4a418..fdf911d 100644
+--- a/locale.c
++++ b/locale.c
+@@ -674,7 +674,10 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
+
+ const bool locwarn = (printwarn > 1
+ || (printwarn
+- && (! bad_lang_use_once
++ &&
++ /* Debian specific change - see http://bugs.debian.org/508764 */
++ (!PerlEnv_getenv("DPKG_RUNNING_VERSION")) &&
++ (! bad_lang_use_once
+ || (
+ /* disallow with "" or "0" */
+ *bad_lang_use_once
+diff --git a/pod/perllocale.pod b/pod/perllocale.pod
+index 701b422..58cabaf 100644
+--- a/pod/perllocale.pod
++++ b/pod/perllocale.pod
+@@ -1217,6 +1217,14 @@ B<NOTE>: C<PERL_BADLANG> only gives you a way to hide the warning message.
+ The message tells about some problem in your system's locale support,
+ and you should investigate what the problem is.
+
++=item DPKG_RUNNING_VERSION
++
++On Debian systems, if the DPKG_RUNNING_VERSION environment variable is
++set (to any value), the locale failure warnings will be suppressed just
++like with a zero PERL_BADLANG setting. This is done to avoid floods
++of spurious warnings during system upgrades.
++See L<http://bugs.debian.org/508764>.
++
+ =back
+
+ The following environment variables are not specific to Perl: They are
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff
new file mode 100644
index 000000000..53adc2f4d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff
@@ -0,0 +1,36 @@
+From 591c1f9b7d4755bfc59d9665bab1f2ca410de765 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Set umask approproately for site install directories
+
+Policy requires group writable site directories
+
+Patch-Name: debian/writable_site_dirs.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 197f102..5f1b87f 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2138,7 +2138,7 @@ q{ "$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
+
+
+ pure_site_install :: all
+- $(NOECHO) umask 022; $(MOD_INSTALL) \
++ $(NOECHO) umask 02; $(MOD_INSTALL) \
+ };
+ push @m,
+ q{ read "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+@@ -2199,8 +2199,8 @@ doc_perl_install :: all
+
+ doc_site_install :: all
+ $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) umask 022; $(DOC_INSTALL) \
++ -$(NOECHO) umask 02; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++ -$(NOECHO) umask 02; $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" $(INSTALLSITELIB) \
+ LINKTYPE "$(LINKTYPE)" \
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
new file mode 100644
index 000000000..3df593346
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch
@@ -0,0 +1,23 @@
+Hack the dynamic module loader so that we use native modules since we can't load
+the target ones.
+
+Upstream-Status: Inappropriate
+
+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 @@
+ foreach (@INC) {
+ <<$^O-eq-VMS>>chop($_ = VMS::Filespec::unixpath($_));<</$^O-eq-VMS>>
+ my $dir = "$_/auto/$modpname";
++
++ if (defined $ENV{PERL_LIB} and defined $ENV{PERLHOSTLIB}) {
++ $dir =~ s/$ENV{PERL_LIB}/$ENV{PERLHOSTLIB}/g;
++ }
+
+ next unless -d $dir; # skip over uninteresting directories
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch
new file mode 100644
index 000000000..994ef7013
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch
@@ -0,0 +1,35 @@
+From ba4ed0b5b7baad5353c1e65b655f41d45e01c990 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 22 Jun 2015 20:00:11 -0700
+Subject: [PATCH] ext/ODBM_File/hints/linux.pl: link libgdbm_compat
+
+Fixed for test case ../ext/ODBM_File/t/odbm.t:
+ok 1 - use ODBM_File;
+ok 2 - use Fcntl;
+./perl: symbol lookup error: /usr/lib/perl/5.22.0/auto/ODBM_File/ODBM_File.so: undefined symbol: dbminit
+
+The checking "if -e $_.'/libgdbm_compat.so'" doesn't work when cross
+build, so always link libgdbm_compat, since perl depends on gdbm and we
+always have libgdbm_compat.
+
+Upstream-Status:Inappropriate [embedded specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ ext/ODBM_File/hints/linux.pl | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/ext/ODBM_File/hints/linux.pl b/ext/ODBM_File/hints/linux.pl
+index 204bba0..9271b45 100644
+--- a/ext/ODBM_File/hints/linux.pl
++++ b/ext/ODBM_File/hints/linux.pl
+@@ -1,8 +1,2 @@
+ # uses GDBM dbm compatibility feature - at least on SuSE 8.0
+-$self->{LIBS} = ['-lgdbm'];
+-
+-# Debian/Ubuntu have libgdbm_compat.so but not this file,
+-# so linking may fail
+-foreach (split / /, $Config{libpth}) {
+- $self->{LIBS}->[0] .= ' -lgdbm_compat' if -e $_.'/libgdbm_compat.so';
+-}
++$self->{LIBS} = ['-lgdbm -lgdbm_compat'];
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch
new file mode 100644
index 000000000..6b05b877f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch
@@ -0,0 +1,31 @@
+From b842e1de7798a1f7df770bb3f185ad3356e490e6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 22 Jun 2015 20:06:56 -0700
+Subject: [PATCH] ext/ODBM_File/t/odbm.t: fix the path of dbmt_common.pl
+
+It should be lib/dbmt_common.pl when run by run-ptest.
+
+Fixed:
+Can't locate ../../t/lib/dbmt_common.pl in @INC
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ ext/ODBM_File/t/odbm.t | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ext/ODBM_File/t/odbm.t b/ext/ODBM_File/t/odbm.t
+index 079b9f1..250b991 100644
+--- a/ext/ODBM_File/t/odbm.t
++++ b/ext/ODBM_File/t/odbm.t
+@@ -2,7 +2,7 @@
+
+ our $DBM_Class = 'ODBM_File';
+
+-require '../../t/lib/dbmt_common.pl';
++require 'lib/dbmt_common.pl';
+
+ if ($^O eq 'hpux') {
+ print <<EOM;
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch
new file mode 100644
index 000000000..69ac43477
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch
@@ -0,0 +1,24 @@
+Upstream-Status:Inappropriate [embedded specific]
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/07/01
+
+Fix these Package QA warnings before they are converted into fetal errors:
+
+WARNING: QA Issue: package perl-module-compress contains bad RPATH /build_disk/poky_build/build0/tmp/sysroots/qemux86/usr/lib in file /build_disk/poky_build/build0/tmp/work/i586-poky-linux/perl-5.12.3-r1/packages-split/perl-module-compress/usr/lib/perl/5.12.3/auto/Compress/Raw/Zlib/Zlib.so
+
+This fixes this warning for perl recipe as well as libxml-parser-perl recipe.
+It is a fix to MakeMaker within perl, so all such perl recipes will get
+fixed with this perl fix.
+
+Index: perl-5.14.2/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+===================================================================
+--- perl-5.14.2.orig/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
++++ perl-5.14.2/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+@@ -55,6 +55,7 @@ sub _unix_os2_ext {
+ my($found) = 0;
+
+ # Debian-specific: don't use LD_RUN_PATH for standard dirs
++ push(@libpath, "SYSROOTLIB");
+ $ld_run_path_seen{$_}++ for @libpath;
+
+ foreach my $thislib (split ' ', $potential_libs) {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/generate-sh.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/generate-sh.patch
new file mode 100644
index 000000000..27f6e691c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/generate-sh.patch
@@ -0,0 +1,56 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Use the ld flags from the supplied configuration file. For sh we need the
+flags that specify to build PIC code so that the shared libraries work.
+
+Index: perl-5.14.2/Cross/generate_config_sh
+===================================================================
+--- perl-5.14.2.orig/Cross/generate_config_sh 2010-12-30 04:07:14.000000000 +0200
++++ perl-5.14.2/Cross/generate_config_sh 2012-11-22 15:58:49.852852805 +0200
+@@ -19,10 +19,10 @@
+ $callbacks->{'ar'} = [\&simple_process, ["AR", "arm-linux-ar"]];
+ $callbacks->{'archname'} = [\&simple_process, ["SYS", "armv4l-linux"]];
+ $callbacks->{'cc'} = [\&simple_process, ["CC", "arm-linux-gcc"]];
+-$callbacks->{'cccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
+-$callbacks->{'ccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
+-$callbacks->{'ccflags'} = [\&simple_process, ["CFLAGS", "-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
+-$callbacks->{'ccflags_uselargefiles'} = [\&simple_process, ["CFLAGS", "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
++#$callbacks->{'cccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
++#$callbacks->{'ccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
++$callbacks->{'ccflags'} = [\&simple_process_insert, ["CFLAGS", "-fno-strict-aliasing -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
++$callbacks->{'ccflags_uselargefiles'} = [\&simple_process_insert, ["CFLAGS", "-D_GNU_SOURCE -DTHREADS_HAVE_PIDS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
+ $callbacks->{'ccname'} = [\&simple_process, ["CC", "arm-linux-gcc"]];
+ $callbacks->{'cpp'} = [\&simple_process, ["CCP", "arm-linux-cpp"]];
+ $callbacks->{'cppflags'} = [\&simple_process, ["CCPFLAGS", "-fno-strict-aliasing"]];
+@@ -30,6 +30,7 @@
+ $callbacks->{'cppstdin'} = [\&simple_process_append, ["CC", "arm-linux-gcc -E", "-E"]];
+ $callbacks->{'full_ar'} = [\&backtick, ["AR", "which $ENV{AR}", "/usr/local/arm/2.95.3/bin/arm-linux-ar"]];
+ $callbacks->{'ld'} = [\&simple_process, ["LD", "arm-linux-ld"]];
++$callbacks->{'lddlflags'} = [\&simple_process, ["LDDLFLAGS", ""]];
+ $callbacks->{'ldflags'} = [\&simple_process, ["LDFLAGS", ""]];
+ $callbacks->{'ldflags_uselargefiles'} = [\&simple_process, ["LDFLAGS", ""]];
+ $callbacks->{'myarchname'} = [\&simple_process, ["SYS", "armv4l-linux"]];
+@@ -105,6 +106,23 @@
+
+ }
+
++# Insert env var into the variables value
++sub simple_process_insert {
++ my $key = shift;
++ my $value = shift;
++ my $envvar = $callbacks->{$key}->[1][0];
++
++ if ($ENV{$envvar}) {
++ # Strip quotes from value
++ $value =~ s/^\'//;
++ $value =~ s/\'$//;
++ # Remove -I/usr/local/... from the value
++ $value =~ s#\W-I/usr/local/\w+\W# #g;
++ # Prepend env var (OE setting) to value
++ print("$key=\'$ENV{$envvar} $value\'\n");
++ }
++}
++
+ sub library_munge {
+ my $key = shift;
+ my $value = shift;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/installperl.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/installperl.patch
new file mode 100644
index 000000000..456012376
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/installperl.patch
@@ -0,0 +1,17 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.12.3/installperl
+===================================================================
+--- perl-5.12.3.orig/installperl
++++ perl-5.12.3/installperl
+@@ -3,8 +3,8 @@
+ BEGIN {
+ require 5.004;
+ chdir '..' if !-d 'lib' and -d '../lib';
+- @INC = 'lib';
+- $ENV{PERL5LIB} = 'lib';
++# @INC = 'lib';
++# $ENV{PERL5LIB} = 'lib';
+
+ # This needs to be at BEGIN time, before any use of Config
+ require './install_lib.pl';
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch
new file mode 100644
index 000000000..5161e4c8b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch
@@ -0,0 +1,46 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+This removes all the logic that perl uses to locate an appropriate
+errno.h for the target. Instead we simple create a file that does
+
+ #include "errno.h"
+
+and use that as the file to parse. This is needed when using an
+external toolchain since perl will search in ${STAGING_INCDIR} for
+errno.h (when using gcc) and that isn't where it's located - its
+wherever the external toolchain keeps it's headers.
+
+Index: perl-5.12.3/ext/Errno/Errno_pm.PL
+===================================================================
+--- perl-5.12.3.orig/ext/Errno/Errno_pm.PL
++++ perl-5.12.3/ext/Errno/Errno_pm.PL
+@@ -17,8 +17,18 @@ unlink "Errno.tmp" if -f "Errno.tmp";
+ open OUT, ">Errno.tmp" or die "Cannot open Errno.tmp: $!";
+ select OUT;
+ my $file;
+-my @files = get_files();
+-if ($Config{gccversion} ne '' && $^O eq 'MSWin32') {
++#my @files = get_files();
++my @files = ("errno.h");
++
++if (1) {
++ open INCS, '>includes.c' or
++ die "Cannot open includes.c";
++ print INCS qq[#include "errno.h"\n];
++ close INCS;
++ process_file('includes.c');
++ unlink 'includes.c';
++}
++elsif ($Config{gccversion} ne '' && $^O eq 'MSWin32') {
+ # MinGW complains "warning: #pragma system_header ignored outside include
+ # file" if the header files are processed individually, so include them
+ # all in .c file and process that instead.
+@@ -53,7 +63,7 @@ sub process_file {
+ chomp($file = `cygpath -w "$file"`);
+ }
+
+- return unless defined $file and -f $file;
++# return unless defined $file and -f $file;
+ # warn "Processing $file\n";
+
+ local *FH;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch
new file mode 100644
index 000000000..de6f65294
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch
@@ -0,0 +1,30 @@
+make_ext.pl: fix regenerate makefile failed while $cc changed
+
+While $cc changed, the existance of 'xdefine' caused makefile
+regeneration failed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ make_ext.pl | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/make_ext.pl b/make_ext.pl
+index b433762..9fc1a36 100644
+--- a/make_ext.pl
++++ b/make_ext.pl
+@@ -335,6 +335,10 @@ sub build_extension {
+ print "Deleting non-Cross makefile\n";
+ close $mfh or die "close $makefile: $!";
+ _unlink($makefile);
++ if(-e 'xdefine') {
++ print "Deleting xdefine for regenerate makefile\n";
++ _unlink('xdefine');
++ }
+ }
+ }
+ }
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-nopacklist.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-nopacklist.patch
new file mode 100644
index 000000000..5482dcb79
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-nopacklist.patch
@@ -0,0 +1,91 @@
+Upstream-Status:Inappropriate [debian patch]
+
+Part of 52_debian_extutils_hacks.patch just to exclude the installation of .packlist files
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 35 ++---------------------
+ 1 file changed, 3 insertions(+), 32 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index f63145c..a589710 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2122,11 +2122,6 @@ pure_perl_install :: all
+ };
+
+ push @m,
+-q{ read "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
+- write "}.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
+-} unless $self->{NO_PACKLIST};
+-
+- push @m,
+ q{ "$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
+ "$(INST_ARCHLIB)" "$(DESTINSTALLARCHLIB)" \
+ "$(INST_BIN)" "$(DESTINSTALLBIN)" \
+@@ -2158,10 +2153,6 @@ q{ "$(INST_LIB)" "$(DESTINSTALLSITELIB)" \
+ pure_vendor_install :: all
+ $(NOECHO) $(MOD_INSTALL) \
+ };
+- push @m,
+-q{ read "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+- write "}.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{" \
+-} unless $self->{NO_PACKLIST};
+
+ push @m,
+ q{ "$(INST_LIB)" "$(DESTINSTALLVENDORLIB)" \
+@@ -2187,37 +2178,19 @@ doc_vendor_install :: all
+
+ push @m, q{
+ doc_perl_install :: all
+- $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) $(DOC_INSTALL) \
+- "Module" "$(NAME)" \
+- "installed into" $(INSTALLPRIVLIB) \
+- LINKTYPE "$(LINKTYPE)" \
+- VERSION "$(VERSION)" \
+- EXE_FILES "$(EXE_FILES)" \
+- >> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
+
+ doc_site_install :: all
+- $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
++ $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLSITEARCH)/perllocal.pod"
++ -$(NOECHO) $(MKPATH) "$(DESTINSTALLSITEARCH)"
+ -$(NOECHO) $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" $(INSTALLSITELIB) \
+ LINKTYPE "$(LINKTYPE)" \
+ VERSION "$(VERSION)" \
+ EXE_FILES "$(EXE_FILES)" \
+- >> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
++ >> "}.$self->catfile('$(DESTINSTALLSITEARCH)','perllocal.pod').q{"
+
+ doc_vendor_install :: all
+- $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) $(DOC_INSTALL) \
+- "Module" "$(NAME)" \
+- "installed into" $(INSTALLVENDORLIB) \
+- LINKTYPE "$(LINKTYPE)" \
+- VERSION "$(VERSION)" \
+- EXE_FILES "$(EXE_FILES)" \
+- >> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
+
+ } unless $self->{NO_PERLLOCAL};
+
+@@ -2226,13 +2199,11 @@ uninstall :: uninstall_from_$(INSTALLDIRS)dirs
+ $(NOECHO) $(NOOP)
+
+ uninstall_from_perldirs ::
+- $(NOECHO) $(UNINSTALL) "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{"
+
+ uninstall_from_sitedirs ::
+ $(NOECHO) $(UNINSTALL) "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
+
+ uninstall_from_vendordirs ::
+- $(NOECHO) $(UNINSTALL) "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
+ };
+
+ join("",@m);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-perlinc.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-perlinc.patch
new file mode 100644
index 000000000..f0bb1f659
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/native-perlinc.patch
@@ -0,0 +1,26 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.8.8/lib/ExtUtils/MM_Unix.pm
+===================================================================
+--- perl-5.12.3.orig/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 2008-10-31 22:01:35.000000000 +0000
++++ perl-5.12.3/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 2008-10-31 22:01:35.000000000 +0000
+@@ -1597,6 +1597,19 @@
+ $self->{PERL_LIB} ||= $Config{privlibexp};
+ $self->{PERL_ARCHLIB} ||= $Config{archlibexp};
+ $self->{PERL_INC} = $self->catdir("$self->{PERL_ARCHLIB}","CORE"); # wild guess for now
++ # Check for environment override so we'll find the headers in the correct place
++ if (defined $ENV{PERL_LIB})
++ {
++ $self->{PERL_LIB} = $ENV{PERL_LIB};
++ }
++ if (defined $ENV{PERL_ARCHLIB})
++ {
++ $self->{PERL_ARCHLIB} = $ENV{PERL_ARCHLIB};
++ }
++ if (defined $ENV{PERL_INC})
++ {
++ $self->{PERL_INC} = $ENV{PERL_INC};
++ }
+ my $perl_h;
+
+ if (not -f ($perl_h = $self->catfile($self->{PERL_INC},"perl.h"))
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-PathTools-don-t-filter-out-blib-from-INC.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-PathTools-don-t-filter-out-blib-from-INC.patch
new file mode 100644
index 000000000..7dd904140
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-PathTools-don-t-filter-out-blib-from-INC.patch
@@ -0,0 +1,33 @@
+From 90c252cecc38aed5d5faedb30485dd6eee2e54eb Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Wed, 11 Feb 2015 15:14:40 +0800
+Subject: [PATCH] perl / PathTools: don't filter out blib from @INC
+
+If $TOPDIR includes the string "blib", filter it out from @INC may empty
+the @INC and cause build errors like:
+
+ Can't locate ExtUtils/MakeMaker.pm in @INC \
+ (you may need to install the ExtUtils::MakeMaker module) \
+ (@INC contains: .) at Makefile.PL
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ dist/PathTools/Makefile.PL | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/dist/PathTools/Makefile.PL b/dist/PathTools/Makefile.PL
+index 1b21de4..f562cb2 100644
+--- a/dist/PathTools/Makefile.PL
++++ b/dist/PathTools/Makefile.PL
+@@ -1,6 +1,3 @@
+-
+-BEGIN { @INC = grep {!/blib/} @INC }
+-
+ require 5.005;
+ use ExtUtils::MakeMaker;
+ WriteMakefile
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch
new file mode 100644
index 000000000..d912d0031
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch
@@ -0,0 +1,40 @@
+perl: add archlib_exp variable used to generate ARCHLIB_EXP in config.h
+
+perl.c uses an ARCHLIB_EXP define to generate compile-time code that
+adds the archlibexp path to @INC during run-time initialization of a
+new perl interpreter.
+
+Because we've changed this value in a temporary way to make it
+possible to use ExtUtils::Embed in the target build (the temporary
+value in config.sh gets re-stripped out during packaging), the
+ARCHLIB_EXP value that gets generated still uses the temporary version
+instead of the original expected version (i.e. becauses it's in the
+generated config.h, it doesn't get stripped out during packaging like
+the others in config.sh).
+
+This creates an unmodified version called archlib_exp that gets used
+by a modified config_h.SH to get the correct value into config.h
+
+This patch uses an unmodified version of archlibexp called
+archlib_exp, introduced to config.sh, which is used to generate the
+correct value of ARCHLIB_EXP into config.h
+
+See YOCTO #3099 for more info.
+
+Upstream-Status:Inappropriate [embedded specific]
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: perl-5.14.2/config_h.SH
+===================================================================
+--- perl-5.14.2.orig/config_h.SH
++++ perl-5.14.2/config_h.SH
+@@ -996,7 +996,7 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#und
+ * in programs that are not prepared to deal with ~ expansion at run-time.
+ */
+ #$d_archlib ARCHLIB "$archlib" /**/
+-#$d_archlib ARCHLIB_EXP "$archlibexp" /**/
++#$d_archlib ARCHLIB_EXP "$archlib_exp" /**/
+
+ /* ARCHNAME:
+ * This symbol holds a string representing the architecture name.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch
new file mode 100644
index 000000000..c6cc15c93
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch
@@ -0,0 +1,47 @@
+Upstream-Status:Inappropriate [native]
+
+This patch is used for perl-native only. It enables the switching of
+configuration files between Config_heavy.pl and
+Config_heavy-target.pl by setting the environment variables
+PERLCONFIGTARGET - the later containing settings for the target while
+the former contains those for the host. This will allow cpan.bbclass
+to use the settings appropriate for the native and/or target builds
+as required. This also disables the use of the cache since the cached
+values would be valid for the host only.
+
+Index: perl-5.14.2/configpm
+===================================================================
+--- perl-5.14.2.orig/configpm
++++ perl-5.14.2/configpm
+@@ -658,7 +658,7 @@ sub FETCH {
+ my($self, $key) = @_;
+
+ # check for cached value (which may be undef so we use exists not defined)
+- return exists $self->{$key} ? $self->{$key} : $self->fetch_string($key);
++ return $self->fetch_string($key);
+ }
+
+ ENDOFEND
+@@ -816,7 +816,21 @@ $config_txt .= sprintf <<'ENDOFTIE', $fa
+ sub DESTROY { }
+
+ sub AUTOLOAD {
+- require 'Config_heavy.pl';
++ my $cfgfile = 'Config_heavy.pl';
++ if (defined $ENV{PERLCONFIGTARGET} and $ENV{PERLCONFIGTARGET} eq "yes")
++ {
++ $cfgfile = 'Config_heavy-target.pl';
++ }
++ if (defined $ENV{PERL_ARCHLIB})
++ {
++ push @INC, $ENV{PERL_ARCHLIB};
++ require $cfgfile;
++ pop @INC;
++ }
++ else
++ {
++ require $cfgfile;
++ }
+ goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/;
+ die "&Config::AUTOLOAD failed on $Config::AUTOLOAD";
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configure.sh b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configure.sh
new file mode 100755
index 000000000..e72ce49f9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-configure.sh
@@ -0,0 +1,43 @@
+#! /bin/sh
+
+#
+# Generate the common perl configuration
+# Needs to be run on a host that matches the bitsize of the target platform
+#
+
+echo sh Configure -des \
+ -Doptimize=-O2 \
+ -Dmyhostname=localhost \
+ -Dperladmin=root@localhost \
+ -Dcc=gcc \
+ -Dcf_by='Open Embedded' \
+ -Dinstallprefix=@DESTDIR@ \
+ -Dprefix=/usr \
+ -Dvendorprefix=/usr \
+ -Dsiteprefix=/usr \
+ -Dotherlibdirs=/usr/lib/perl5/5.12.3 \
+ -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='/usr/bin/less -isr'
+
+cp -f config.sh config.sh.COMMON
+
+TARGETOS=$(grep myarchname config.sh.COMMON | sed "s#.*'\(.*\)'.*#\1#")
+
+sed -r -i config.sh.COMMON \
+ -e "s#(install.*=')(/usr)/local(.*')#\1@DESTDIR@\2\3#g" \
+ -e 's#'$TARGETOS'#@ARCH@#g'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-dynloader.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-dynloader.patch
new file mode 100644
index 000000000..035beba66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-dynloader.patch
@@ -0,0 +1,34 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Allow the location that .so files are searched for for dynamic
+loading to be changed via an environment variable. This is to allow
+us to load .so's from the host system while building for the target
+system.
+
+Update by Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/21
+
+Index: perl-5.14.2/dist/XSLoader/XSLoader_pm.PL
+===================================================================
+--- perl-5.14.2.orig/dist/XSLoader/XSLoader_pm.PL
++++ perl-5.14.2/dist/XSLoader/XSLoader_pm.PL
+@@ -28,6 +28,20 @@ sub load {
+
+ my ($module, $modlibname) = caller();
+
++ # OE: Allow env to form dynamic loader to look in a different place
++ # This is so it finds the host .so files, not the targets
++ if (defined $ENV{PERLHOSTLIB})
++ {
++ my $hostlib = $ENV{PERLHOSTLIB};
++ print STDERR "*** Module name IN: $modlibname\n";
++ ($p1, $p2, $p3, $p4, $p5) = $modlibname =~ m/(^(.*lib\w*\/)?)((perl\/[0-9\.]*\/)?)(.*)$/;
++ print STDERR "*** p1: $p1 p3: $p3 p5: $p5\n";
++ if ( $p1 ne "" ) {
++ $modlibname = $hostlib.$p5;
++ }
++ print STDERR "*** Module name OUT: $modlibname\n";
++ }
++
+ if (@_) {
+ $module = $_[0];
+ } else {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-enable-gdbm.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-enable-gdbm.patch
new file mode 100644
index 000000000..aa83fca5a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-enable-gdbm.patch
@@ -0,0 +1,19 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.8.8/config_h.SH
+===================================================================
+--- perl-5.8.8.orig/config_h.SH 2005-11-01 02:13:05.000000000 +0800
++++ perl-5.8.8/config_h.SH 2010-11-01 17:06:07.215219738 +0800
+@@ -709,6 +709,12 @@
+ */
+ #$i_float I_FLOAT /**/
+
++/* I_GDBM:
++ * This symbol, if defined, indicates that <gdbm.h> exists and should
++ * be included.
++ */
++#$i_gdbm I_GDBM /**/
++
+ /* I_LIMITS:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <limits.h> to get definition of symbols like WORD_BIT or
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-errno-generation-gcc5.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-errno-generation-gcc5.patch
new file mode 100644
index 000000000..7379d8b81
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-errno-generation-gcc5.patch
@@ -0,0 +1,37 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+The upstream code assumes that the compiler version used to compiler miniperl/perl-native
+is the same as the one being used to build the perl binary. Since most people are not running
+systems with gcc 5, it is unlikely that it will work on any supported host. Switch out gccversion
+for the version extracted from $CC --version.
+
+Jeremy Puhlman <jpuhlman@mvista.com>
+
+Fix spaces in brackets while running $CC --version
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ ext/Errno/Errno_pm.PL | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
+index 1fd29d0..7976ea2 100644
+--- a/ext/Errno/Errno_pm.PL
++++ b/ext/Errno/Errno_pm.PL
+@@ -224,9 +224,13 @@ sub write_errno_pm {
+
+ { # BeOS (support now removed) did not enter this block
+ # invoke CPP and read the output
++ my $compiler = $ENV{'CC'};
++ my $compiler_out = `$compiler --version`;
++ $compiler_out =~ s/\(.*\)/;/;
++ my @compiler_version = split / /,$compiler_out;
+
+ my $inhibit_linemarkers = '';
+- if ($Config{gccversion} =~ /\A(\d+)\./ and $1 >= 5) {
++ if (@compiler_version[2] =~ /\A(\d+)\./ and $1 >= 5) {
+ # GCC 5.0 interleaves expanded macros with line numbers breaking
+ # each line into multiple lines. RT#123784
+ $inhibit_linemarkers = ' -P';
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-moreconfig.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-moreconfig.patch
new file mode 100644
index 000000000..59ce85a7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-moreconfig.patch
@@ -0,0 +1,18 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+We need ld in the fake config library, but it's not included by default. So
+expand the number of items included. While this works it indicates that the
+rest of the config items are not being picked up and/or are being picked up
+from the host. More investigation needed.
+
+--- perl-5.8.8/configpm 2007/04/20 09:48:05 1.1
++++ perl-5.8.8/configpm 2007/04/20 09:57:12
+@@ -2,7 +2,7 @@
+ use strict;
+ use vars qw(%Config $Config_SH_expanded);
+
+-my $how_many_common = 22;
++my $how_many_common = 50;
+
+ # commonly used names to precache (and hence lookup fastest)
+ my %Common;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/run-ptest
new file mode 100644
index 000000000..1e2dd1b66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+cd t && ./TEST | sed -u -e 's|\(.*\) .* ok$|PASS: \1|' -e 's|\(.*\) .* skipped|SKIP: \1|' -e 's|\(.*\) \.\(.*\)|FAIL: \1|'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch
new file mode 100644
index 000000000..03fdf4ab9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch
@@ -0,0 +1,30 @@
+From 1561549ea36e37cc25706f094a195de4928f4211 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 19 Jun 2015 01:23:46 -0700
+Subject: [PATCH] t/run/switches.t: perl5 -> perl
+
+We call it perl rather than perl5 in oe.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ t/run/switches.t | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/t/run/switches.t b/t/run/switches.t
+index 78915e0..e9e4b45 100644
+--- a/t/run/switches.t
++++ b/t/run/switches.t
+@@ -269,7 +269,7 @@ is runperl(stderr => 1, prog => '#!perl -M'),
+ '-V generates 20+ lines' );
+
+ like( runperl( switches => ['-V'] ),
+- qr/\ASummary of my perl5 .*configuration:/,
++ qr/\ASummary of my perl .*configuration:/,
+ '-V looks okay' );
+
+ # lookup a known config var
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/test/dist-threads-t-join.t-adjust-ps-option.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/test/dist-threads-t-join.t-adjust-ps-option.patch
new file mode 100644
index 000000000..c8293c3d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/test/dist-threads-t-join.t-adjust-ps-option.patch
@@ -0,0 +1,38 @@
+dist/threads/t/join.t: adjust ps option
+
+The ps's option '-f' is not supported by busybox in oe.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ dist/threads/t/join.t | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/dist/threads/t/join.t b/dist/threads/t/join.t
+--- a/dist/threads/t/join.t
++++ b/dist/threads/t/join.t
+@@ -118,7 +118,7 @@ if ($^O eq 'linux') {
+ })->join;
+ #print "# mainthread: \$0 = $0\n";
+ #print "# pid = $$\n";
+- if (open PS, "ps -f |") { # Note: must work in (all) systems.
++ if (open PS, "ps |") { # Note: must work in (all) systems.
+ my ($sawpid, $sawexe);
+ while (<PS>) {
+ chomp;
+@@ -135,10 +135,10 @@ if ($^O eq 'linux') {
+ if ($sawpid) {
+ ok($sawpid && $sawexe, 'altering $0 is effective');
+ } else {
+- skip("\$0 check: did not see pid $$ in 'ps -f |'");
++ skip("\$0 check: did not see pid $$ in 'ps |'");
+ }
+ } else {
+- skip("\$0 check: opening 'ps -f |' failed: $!");
++ skip("\$0 check: opening 'ps |' failed: $!");
+ }
+ } else {
+ skip("\$0 check: only on Linux");
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch
new file mode 100644
index 000000000..ce577fe5f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch
@@ -0,0 +1,26 @@
+ext/DynaLoader/t/DynaLoader.t: fix calling dl_findfile() failed
+
+Use '$Config{libc}' as the libc file name
+
+Upstream-Status: Inappropriate
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ ext/DynaLoader/t/DynaLoader.t | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ext/DynaLoader/t/DynaLoader.t b/ext/DynaLoader/t/DynaLoader.t
+index ade1f8e..3567afe 100644
+--- a/ext/DynaLoader/t/DynaLoader.t
++++ b/ext/DynaLoader/t/DynaLoader.t
+@@ -106,7 +106,7 @@ ok( defined $dlerr, "dl_error() returning an error message: '$dlerr'" );
+ # ... dl_findfile()
+ SKIP: {
+ my @files = ();
+- eval { @files = DynaLoader::dl_findfile("c") };
++ eval { @files = DynaLoader::dl_findfile($Config{libc}) };
+ is( $@, '', "calling dl_findfile()" );
+ # Some platforms are known to not have a "libc"
+ # (not at least by that name) that the dl_findfile()
+--
+1.8.1.2
+
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
new file mode 100644
index 000000000..bf8b3b60b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl_5.22.1.bb
@@ -0,0 +1,367 @@
+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 \
+"
+
+# 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 "
+
+python populate_packages_prepend () {
+ 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/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch b/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch
new file mode 100644
index 000000000..01c62472c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch
@@ -0,0 +1,45 @@
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+
+Index: pkg-config-0.28/glib/configure.ac
+===================================================================
+--- pkg-config-0.28.orig/glib/configure.ac
++++ pkg-config-0.28/glib/configure.ac
+@@ -1438,7 +1438,7 @@ if test x"$glib_native_win32" = xyes; th
+ G_MODULE_LDFLAGS=
+ else
+ export SED
+- G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
++ G_MODULE_LDFLAGS=`(./${host_alias}-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
+ fi
+ dnl G_MODULE_IMPL= don't reset, so cmd-line can override
+ G_MODULE_NEED_USCORE=0
+@@ -1503,13 +1503,13 @@ if test "$G_MODULE_IMPL" = "G_MODULE_IMP
+ LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
+ dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness
+ echo "void glib_plugin_test(void) { }" > plugin.c
+- ${SHELL} ./libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
++ ${SHELL} ./${host_alias}-libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
+ ${CPPFLAGS} -c -o plugin.lo plugin.c >/dev/null 2>&1
+- ${SHELL} ./libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
++ ${SHELL} ./${host_alias}-libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
+ ${LDFLAGS} -module -o plugin.la -export-dynamic \
+ -shrext ".o" -avoid-version plugin.lo \
+ -rpath /dont/care >/dev/null 2>&1
+- eval `./libtool --config | grep ^objdir`
++ eval `./${host_alias}-libtool --config | grep ^objdir`
+ AC_CACHE_CHECK([for RTLD_GLOBAL brokenness],
+ glib_cv_rtldglobal_broken,[
+ AC_TRY_RUN([
+@@ -1582,7 +1582,7 @@ fi
+
+ AC_MSG_CHECKING(for the suffix of module shared libraries)
+ export SED
+-shrext_cmds=`./libtool --config | grep '^shrext_cmds='`
++shrext_cmds=`./${host_alias}-libtool --config | grep '^shrext_cmds='`
+ eval $shrext_cmds
+ module=yes eval std_shrext=$shrext_cmds
+ # chop the initial dot
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in b/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in
new file mode 100644
index 000000000..5e44bb435
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+PKG_CONFIG_PATH="@PATH_NATIVE@"
+PKG_CONFIG_LIBDIR="@LIBDIR_NATIVE@"
+unset PKG_CONFIG_SYSROOT_DIR
+
+pkg-config "$@"
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
new file mode 100644
index 000000000..d34f608f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
@@ -0,0 +1,53 @@
+SUMMARY = "Helper tool used when compiling"
+DESCRIPTION = "pkg-config is a helper tool used when compiling applications and libraries. It helps determined \
+the correct compiler/link options. It is also language-agnostic."
+HOMEPAGE = "http://pkg-config.freedesktop.org/wiki/"
+BUGTRACKER = "http://bugs.freedesktop.org/buglist.cgi?product=pkg-config"
+SECTION = "console/utils"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+DEPENDS = "glib-2.0"
+DEPENDS_class-native = ""
+DEPENDS_class-nativesdk = ""
+
+SRCREV = "5914edfe9604abfedd220103cbac382fc4d268bb"
+PV = "0.29+git${SRCPV}"
+
+SRC_URI = "git://anongit.freedesktop.org/pkg-config \
+ file://pkg-config-native.in \
+ file://fix-glib-configure-libtool-usage.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+EXTRA_OECONF = "--without-internal-glib"
+EXTRA_OECONF_class-native = "--with-internal-glib"
+EXTRA_OECONF_class-nativesdk = "--with-internal-glib"
+
+acpaths = "-I ."
+
+BBCLASSEXTEND = "native nativesdk"
+
+# Set an empty dev package to ensure the base PN package gets
+# the pkg.m4 macros, pkgconfig does not deliver any other -dev
+# files.
+FILES_${PN}-dev = ""
+FILES_${PN} += "${datadir}/aclocal/pkg.m4"
+
+# When using the RPM generated automatic package dependencies, some packages
+# will end up requiring 'pkgconfig(pkg-config)'. Allow this behavior by
+# specifying an appropriate provide.
+RPROVIDES_${PN} += "pkgconfig(pkg-config)"
+
+# Install a pkg-config-native wrapper that will use the native sysroot instead
+# of the MACHINE sysroot, for using pkg-config when building native tools.
+do_install_append_class-native () {
+ sed -e "s|@PATH_NATIVE@|${PKG_CONFIG_PATH}|" \
+ -e "s|@LIBDIR_NATIVE@|${PKG_CONFIG_LIBDIR}|" \
+ < ${WORKDIR}/pkg-config-native.in > ${B}/pkg-config-native
+ install -m755 ${B}/pkg-config-native ${D}${bindir}/pkg-config-native
+}
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
new file mode 100644
index 000000000..7dc45c68f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/postinst-intercept/nativesdk-postinst-intercept_1.0.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Postinstall scriptlets"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+FILES_${PN}_append = " ${datadir}/postinst-intercepts/*"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ install -d ${D}${datadir}/postinst-intercepts
+ install -m 755 ${COREBASE}/scripts/postinst-intercepts/postinst_intercept ${D}${datadir}/postinst-intercepts/
+ install -m 755 ${COREBASE}/scripts/postinst-intercepts/update_font_cache ${D}${datadir}/postinst-intercepts/
+ install -m 755 ${COREBASE}/scripts/postinst-intercepts/update_icon_cache ${D}${datadir}/postinst-intercepts/
+ install -m 755 ${COREBASE}/scripts/postinst-intercepts/update_pixbuf_cache ${D}${datadir}/postinst-intercepts/
+}
+
+inherit nativesdk
+INHIBIT_DEFAULT_DEPS = "1"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/macros.prelink b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/macros.prelink
new file mode 100644
index 000000000..cb1669588
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/macros.prelink
@@ -0,0 +1,5 @@
+# rpm-4.1 verifies prelinked libraries using a prelink undo helper.
+# Note: The 2nd token is used as argv[0] and "library" is a
+# placeholder that will be deleted and replaced with the appropriate
+# library file path.
+%__prelink_undo_cmd /usr/sbin/prelink prelink -y library
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.conf b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.conf
new file mode 100644
index 000000000..562f23c59
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.conf
@@ -0,0 +1,18 @@
+# This config file contains a list of directories both with binaries
+# and libraries prelink should consider by default.
+# If a directory name is prefixed with `-l ', the directory hierarchy
+# will be walked as long as filesystem boundaries are not crossed.
+# If a directory name is prefixed with `-h ', symbolic links in a
+# directory hierarchy are followed.
+-l /usr/local/sbin
+-l /sbin
+-l /usr/sbin
+-l /usr/local/bin
+-l /bin
+-l /usr/bin
+-l /usr/X11R6/bin
+-l /usr/games
+-l /usr/local/lib{,32,64,x32}
+-l /lib{,32,64,x32}
+-l /usr/lib{,32,64,x32}
+-l /usr/X11R6/lib{,32,64,x32}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.cron.daily b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.cron.daily
new file mode 100644
index 000000000..0b3c07322
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.cron.daily
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+. /etc/default/prelink
+
+renice +19 -p $$ >/dev/null 2>&1
+
+if [ "$PRELINKING" != yes ]; then
+ if [ -f /etc/prelink.cache ]; then
+ echo /usr/sbin/prelink -uav > /var/log/prelink.log
+ /usr/sbin/prelink -uav >> /var/log/prelink.log 2>&1
+ rm -f /etc/prelink.cache
+ # Restart init if needed
+ [ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+ fi
+ exit 0
+fi
+
+if [ ! -f /etc/prelink.cache -o -f /var/lib/misc/prelink.force ] \
+ || grep -q '^prelink-ELF0.[0-2]' /etc/prelink.cache; then
+ # If cache does not exist or is from older prelink versions or
+ # if we were asked to explicitely, force full prelinking
+ rm -f /etc/prelink.cache /var/lib/misc/prelink.force
+ PRELINK_OPTS="$PRELINK_OPTS -f"
+ date > /var/lib/misc/prelink.full
+elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \
+ -a "`find /var/lib/misc/prelink.full -mtime -${PRELINK_FULL_TIME_INTERVAL} 2>/dev/null`" \
+ = /var/lib/misc/prelink.full ]; then
+ # If prelink without -q has been run in the last
+ # PRELINK_FULL_TIME_INTERVAL days, just use quick mode
+ PRELINK_OPTS="$PRELINK_OPTS -q"
+else
+ date > /var/lib/misc/prelink.full
+fi
+
+echo /usr/sbin/prelink -av $PRELINK_OPTS > /var/log/prelink.log
+/usr/sbin/prelink -av $PRELINK_OPTS >> /var/log/prelink.log 2>&1
+# Restart init if needed
+[ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+
+exit 0
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.default b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.default
new file mode 100644
index 000000000..d8802f820
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink/prelink.default
@@ -0,0 +1,22 @@
+# Set this to no to disable prelinking altogether
+# or to yes to enable it.
+# (if you change this from yes to no prelink -ua
+# will be run next night to undo prelinking)
+PRELINKING=yes
+
+# Options to pass to prelink
+# -m Try to conserve virtual memory by allowing overlapping
+# assigned virtual memory slots for libraries which
+# never appear together in one binary
+# -R Randomize virtual memory slot assignments for libraries.
+# This makes it slightly harder for various buffer overflow
+# attacks, since library addresses will be different on each
+# host using -R.
+PRELINK_OPTS=-mR
+
+# How often should full prelink be run (in days)
+# Normally, prelink will be run in quick mode, every
+# $PRELINK_FULL_TIME_INTERVAL days it will be run
+# in normal mode. Comment this line out if prelink
+# should be run in normal mode always.
+PRELINK_FULL_TIME_INTERVAL=14
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
new file mode 100644
index 000000000..e223ef689
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/prelink/prelink_git.bb
@@ -0,0 +1,81 @@
+SECTION = "devel"
+# Need binutils for libiberty.a
+# Would need transfig-native for documentation if it wasn't disabled
+DEPENDS = "elfutils binutils"
+SUMMARY = "An ELF prelinking utility"
+DESCRIPTION = "The prelink package contains a utility which modifies ELF shared libraries \
+and executables, so that far fewer relocations need to be resolved at \
+runtime and thus programs come up faster."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b"
+SRCREV = "927979bbd115eeb8a75db3231906ef6aca4c4eb6"
+PV = "1.0+git${SRCPV}"
+
+#
+# The cron script attempts to re-prelink the system daily -- on
+# systems where users are adding applications, this might be reasonable
+# but for embedded, we should be re-running prelink -a after an update.
+#
+# Default is prelinking is enabled.
+#
+SUMMARY_${PN}-cron = "Cron scripts to control automatic prelinking"
+DESCRIPTION_${PN}-cron = "Cron scripts to control automatic prelinking. \
+See: ${sysconfdir}/cron.daily/prelink for configuration information."
+
+FILES_${PN}-cron = "${sysconfdir}/cron.daily ${sysconfdir}/default"
+
+PACKAGES =+ "${PN}-cron"
+
+SRC_URI = "git://git.yoctoproject.org/prelink-cross.git;branch=cross_prelink \
+ file://prelink.conf \
+ file://prelink.cron.daily \
+ file://prelink.default \
+ file://macros.prelink"
+
+TARGET_OS_ORIG := "${TARGET_OS}"
+OVERRIDES_append = ":${TARGET_OS_ORIG}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF = "--disable-selinux --with-pkgversion=${PV}-${PR} \
+ --with-bugurl=http://bugzilla.yoctoproject.org/"
+
+do_configure_prepend () {
+ # Disable documentation!
+ echo "all:" > ${S}/doc/Makefile.am
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/cron.daily ${D}${sysconfdir}/default ${D}${sysconfdir}/rpm
+ install -m 0644 ${WORKDIR}/prelink.conf ${D}${sysconfdir}/prelink.conf
+ install -m 0644 ${WORKDIR}/prelink.cron.daily ${D}${sysconfdir}/cron.daily/prelink
+ install -m 0644 ${WORKDIR}/prelink.default ${D}${sysconfdir}/default/prelink
+ install -m 0644 ${WORKDIR}/macros.prelink ${D}${sysconfdir}/rpm/macros.prelink
+}
+
+# If we're using image-prelink, we want to skip this on the host side
+# but still do it if the package is installed on the target...
+pkg_postinst_prelink() {
+#!/bin/sh
+
+if [ "x$D" != "x" ]; then
+ ${@bb.utils.contains('USER_CLASSES', 'image-prelink', 'exit 0', 'exit 1', d)}
+fi
+
+prelink -a
+}
+
+pkg_prerm_prelink() {
+#!/bin/sh
+
+if [ "x$D" != "x" ]; then
+ exit 1
+fi
+
+prelink -au
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch
new file mode 100644
index 000000000..43504eaab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch
@@ -0,0 +1,44 @@
+From b5545c08e6c674c49aef14b47a56a3e92df4d2a7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 17 Feb 2016 07:36:34 +0000
+Subject: [pseudo][PATCH] configure: Prune PIE flags
+
+LDFLAGS are not taken from environment and CFLAGS is used for LDFLAGS
+however when using security options -fpie and -pie options are coming
+as part of ARCH_FLAGS and they get into LDFLAGS of shared objects as
+well so we end up with conflicting options -shared -pie, which gold
+rejects outright and bfd linker lets the one appearning last in cmdline
+take effect. This create quite a unpleasant situation in OE when
+security flags are enabled and gold or not-gold options are used
+it errors out but errors are not same.
+
+Anyway, with this patch we filter pie options from ARCH_FLAGS
+ouright and take control of generating PIC objects
+
+Helps with errors like
+
+| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: pseudo_client.o: relocation R_X86_64_PC32 against symbol `pseudo_util_debug_flags' can not be used when making a shared object; recompile with -fPIC
+| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: final link failed: Bad value
+| collect2: error: ld returned 1 exit status
+| make: *** [lib/pseudo/lib64/libpseudo.so] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ configure | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure b/configure
+index e5ef9ce..83b0890 100755
+--- a/configure
++++ b/configure
+@@ -339,3 +339,5 @@ sed -e '
+ s,@ARCH@,'"$opt_arch"',g
+ s,@BITS@,'"$opt_bits"',g
+ ' < Makefile.in > Makefile
++
++sed -i -e 's/\-[f]*pie//g' Makefile
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-group b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-group
new file mode 100644
index 000000000..81bf73231
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-group
@@ -0,0 +1,2 @@
+root:*:0:
+mail:*:8:
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
new file mode 100644
index 000000000..c1458dc0f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd
@@ -0,0 +1 @@
+root::0:0:root:/home/root:/bin/sh
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/handle-remove-xattr.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/handle-remove-xattr.patch
new file mode 100644
index 000000000..8b7f30c66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/handle-remove-xattr.patch
@@ -0,0 +1,36 @@
+From a24cf102967a4966bfabe36c3542fb65f35bf539 Mon Sep 17 00:00:00 2001
+From: Peter Seebach <peter.seebach@windriver.com>
+Date: Wed, 23 Mar 2016 11:55:25 -0500
+Subject: actually handle remove_xattr correctly
+
+The path is required but wasn't being extracted from the client's message,
+resulting in xattr removal never working. This does not fully address some
+deeper problems with the xattr implementation, but at least the common
+removal case works.
+
+Upstream-Status: Backport
+
+Index: pseudo-1.7.5/ChangeLog.txt
+===================================================================
+--- pseudo-1.7.5.orig/ChangeLog.txt
++++ pseudo-1.7.5/ChangeLog.txt
+@@ -1,3 +1,7 @@
++2016-03-22:
++ * (seebs) extract path from message for remove_xattr so it
++ actually works.
++
+ 2016-02-09:
+ * (seebs) 1.7.5 release
+
+Index: pseudo-1.7.5/pseudo.c
+===================================================================
+--- pseudo-1.7.5.orig/pseudo.c
++++ pseudo-1.7.5/pseudo.c
+@@ -543,6 +543,7 @@ pseudo_op(pseudo_msg_t *msg, const char
+ case OP_GET_XATTR:
+ case OP_LIST_XATTR:
+ case OP_REPLACE_XATTR:
++ case OP_REMOVE_XATTR:
+ case OP_SET_XATTR:
+ /* In a rename there are two paths, null separated in msg->path */
+ initial_len = strlen(msg->path);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/moreretries.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/moreretries.patch
new file mode 100644
index 000000000..c1e555236
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/moreretries.patch
@@ -0,0 +1,19 @@
+Increase the number of retries in pseudo due to occasional slow
+server shutdowns.
+
+Upstream-Status: Pending
+RP 2016/2/28
+
+Index: pseudo-1.7.5/pseudo_client.c
+===================================================================
+--- pseudo-1.7.5.orig/pseudo_client.c
++++ pseudo-1.7.5/pseudo_client.c
+@@ -1214,7 +1214,7 @@ pseudo_client_setup(void) {
+ return 1;
+ }
+
+-#define PSEUDO_RETRIES 50
++#define PSEUDO_RETRIES 250
+ static pseudo_msg_t *
+ pseudo_client_request(pseudo_msg_t *msg, size_t len, const char *path) {
+ pseudo_msg_t *response = 0;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo.inc b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo.inc
new file mode 100644
index 000000000..0de7b3615
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo.inc
@@ -0,0 +1,134 @@
+# Note: Due to the bitbake wrapper script, making changes to pseudo can be
+# difficult. To work around the current version of the wrapper use:
+# BBFETCH2=True PSEUDO_BUILD=1 ../bitbake/bin/bitbake pseudo-native [-c CMD]
+
+SUMMARY = "Pseudo gives fake root capabilities to a normal user"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/pseudo"
+LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad"
+SECTION = "base"
+LICENSE = "LGPL2.1"
+DEPENDS = "sqlite3 attr"
+
+FILES_${PN} = "${prefix}/lib/pseudo/lib*/libpseudo.so ${bindir}/* ${localstatedir}/pseudo ${prefix}/var/pseudo"
+INSANE_SKIP_${PN} += "libdir"
+INSANE_SKIP_${PN}-dbg += "libdir"
+
+PROVIDES += "virtual/fakeroot"
+
+MAKEOPTS = ""
+
+inherit siteinfo
+
+do_configure () {
+ :
+}
+
+NO32LIBS ??= "1"
+NO32LIBS_class-nativesdk = "1"
+
+# Compile for the local machine arch...
+do_compile () {
+ if [ "${SITEINFO_BITS}" = "64" ]; then
+ ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
+ else
+ ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
+ fi
+ oe_runmake ${MAKEOPTS}
+}
+do_compile[vardepsexclude] = "SITEINFO_BITS"
+
+maybe_make32() {
+ # We probably don't need to build 32-bit binaries.
+ make32=false
+ if [ "${SITEINFO_BITS}" = "64" ]; then
+ case "${NO32LIBS}" in
+ 0) make32=true
+ ;;
+ 1) make32=false
+ ;;
+ *) # If unset, build 32-bit if we think we can.
+ if [ -e "/usr/include/gnu/stubs-32.h" ]; then
+ make32=true
+ fi
+ ;;
+ esac
+ fi
+ if $make32; then
+ if ! [ -e "/usr/include/gnu/stubs-32.h" ]; then
+ warn_32bit_missing
+ else
+ bbnote "Attempting to build 32-bit libpseudo.so for ${PN}."
+ fi
+ else
+ bbnote "Building/installing only 64-bit libpseudo.so for ${PN}."
+ bbnote "If you need to run 32-bit executables, ensure that NO32LIBS is set to 0."
+ fi
+}
+maybe_make32[vardepsexclude] = "SITEINFO_BITS"
+
+warn_32bit_missing() {
+ bbwarn "Can't find stubs-32.h, but usually need it to build 32-bit libpseudo."
+ bbwarn "If the build fails, install 32-bit developer packages."
+ bbwarn "If you are using 32-bit binaries, the 32-bit libpseudo is NOT optional."
+}
+
+# Two below are the same
+# If necessary compile for the alternative machine arch. This is only
+# necessary in a native build.
+do_compile_prepend_class-native () {
+ maybe_make32
+ if $make32; then
+ # We need the 32-bit libpseudo on a 64-bit machine...
+ # Note that this is not well-tested outside of x86/x86_64.
+
+ # if we're being rebuilt due to a dependency change, we need to make sure
+ # everything is clean before we configure and build -- if we haven't previously
+ # built this will fail and be ignored.
+ make ${MAKEOPTS} distclean || :
+
+ ./configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
+ save_traps=$(trap)
+ trap 'warn_32bit_missing' 0
+ oe_runmake ${MAKEOPTS} libpseudo
+ eval "$save_traps"
+ # prevent it from removing the lib, but remove everything else
+ make 'LIB=foo' ${MAKEOPTS} distclean
+ fi
+}
+
+do_compile_prepend_class-nativesdk () {
+ maybe_make32
+ if $make32; then
+ # We need the 32-bit libpseudo on a 64-bit machine.
+ # Note that this is not well-tested outside of x86/x86_64.
+ ./configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
+ oe_runmake ${MAKEOPTS} libpseudo
+ # prevent it from removing the lib, but remove everything else
+ make 'LIB=foo' ${MAKEOPTS} distclean
+ fi
+}
+
+do_install () {
+ oe_runmake 'DESTDIR=${D}' ${MAKEOPTS} 'LIB=lib/pseudo/lib$(MARK64)' install
+}
+
+# Two below are the same
+# If necessary install for the alternative machine arch. This is only
+# necessary in a native build.
+do_install_append_class-native () {
+ maybe_make32
+ if $make32; then
+ mkdir -p ${D}${prefix}/lib/pseudo/lib
+ cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/.
+ fi
+}
+
+do_install_append_class-nativesdk () {
+ maybe_make32
+ if $make32; then
+ mkdir -p ${D}${prefix}/lib/pseudo/lib
+ cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/.
+ fi
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb
new file mode 100644
index 000000000..b8c20ad65
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb
@@ -0,0 +1,19 @@
+require pseudo.inc
+
+SRC_URI = " \
+ http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \
+ file://fallback-passwd \
+ file://fallback-group \
+"
+
+SRC_URI[md5sum] = "4cd39502f9bd0e734dee80e08b28a5f1"
+SRC_URI[sha256sum] = "9f2caca5f1579a376a509cd81a81156fc208650add9f0af275da9e911f18f291"
+
+PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback"
+
+do_install_append_class-native () {
+ install -d ${D}${sysconfdir}
+ # The fallback files should never be modified
+ install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd
+ install -m 444 ${WORKDIR}/fallback-group ${D}${sysconfdir}/group
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb
new file mode 100644
index 000000000..d90e64445
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb
@@ -0,0 +1,22 @@
+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://handle-remove-xattr.patch \
+"
+
+SRC_URI[md5sum] = "c10209938f03128d0c193f041ff3596d"
+SRC_URI[sha256sum] = "fd89cadec984d3b8202aca465898b1bb4350e0d63ba9aa9ac899f6f50270e688"
+
+PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback"
+
+do_install_append_class-native () {
+ install -d ${D}${sysconfdir}
+ # The fallback files should never be modified
+ install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd
+ install -m 444 ${WORKDIR}/fallback-group ${D}${sysconfdir}/group
+}
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
new file mode 100644
index 000000000..abff1cfd3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -0,0 +1,11 @@
+require pseudo.inc
+
+SRCREV = "786c6d3813622d18e12d36c4aa722af6a417c8fa"
+PV = "1.7.5+git${SRCPV}"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "git://git.yoctoproject.org/pseudo"
+
+S = "${WORKDIR}/git"
+
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
new file mode 100644
index 000000000..189689d4c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc
@@ -0,0 +1,288 @@
+
+# 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
+
+
+
+PROVIDES+="${PN}-2to3 ${PN}-argparse ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-contextlib ${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}-fcntl ${PN}-gdbm ${PN}-hotshot ${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}-plistlib ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${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}-zlib "
+
+PACKAGES="${PN}-dbg ${PN}-2to3 ${PN}-argparse ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-contextlib ${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}-fcntl ${PN}-gdbm ${PN}-hotshot ${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}-plistlib ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${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}-zlib ${PN}-modules"
+
+SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator"
+RDEPENDS_${PN}-2to3="${PN}-core"
+FILES_${PN}-2to3="${bindir}/2to3 ${libdir}/python2.7/lib2to3 "
+
+SUMMARY_${PN}-argparse="Python command line argument parser"
+RDEPENDS_${PN}-argparse="${PN}-core ${PN}-codecs ${PN}-textutils"
+FILES_${PN}-argparse="${libdir}/python2.7/argparse.* "
+
+SUMMARY_${PN}-audio="Python Audio Handling"
+RDEPENDS_${PN}-audio="${PN}-core"
+FILES_${PN}-audio="${libdir}/python2.7/wave.* ${libdir}/python2.7/chunk.* ${libdir}/python2.7/sndhdr.* ${libdir}/python2.7/lib-dynload/ossaudiodev.so ${libdir}/python2.7/lib-dynload/audioop.so ${libdir}/python2.7/audiodev.* ${libdir}/python2.7/sunaudio.* ${libdir}/python2.7/sunau.* ${libdir}/python2.7/toaiff.* "
+
+SUMMARY_${PN}-bsddb="Python bindings for the Berkeley Database"
+RDEPENDS_${PN}-bsddb="${PN}-core"
+FILES_${PN}-bsddb="${libdir}/python2.7/bsddb ${libdir}/python2.7/lib-dynload/_bsddb.so "
+
+SUMMARY_${PN}-codecs="Python codecs, encodings & i18n support"
+RDEPENDS_${PN}-codecs="${PN}-core ${PN}-lang"
+FILES_${PN}-codecs="${libdir}/python2.7/codecs.* ${libdir}/python2.7/encodings ${libdir}/python2.7/gettext.* ${libdir}/python2.7/locale.* ${libdir}/python2.7/lib-dynload/_locale.so ${libdir}/python2.7/lib-dynload/_codecs* ${libdir}/python2.7/lib-dynload/_multibytecodec.so ${libdir}/python2.7/lib-dynload/unicodedata.so ${libdir}/python2.7/stringprep.* ${libdir}/python2.7/xdrlib.* "
+
+SUMMARY_${PN}-compile="Python bytecode compilation support"
+RDEPENDS_${PN}-compile="${PN}-core"
+FILES_${PN}-compile="${libdir}/python2.7/py_compile.* ${libdir}/python2.7/compileall.* "
+
+SUMMARY_${PN}-compiler="Python compiler support"
+RDEPENDS_${PN}-compiler="${PN}-core"
+FILES_${PN}-compiler="${libdir}/python2.7/compiler "
+
+SUMMARY_${PN}-compression="Python high-level compression support"
+RDEPENDS_${PN}-compression="${PN}-core ${PN}-zlib"
+FILES_${PN}-compression="${libdir}/python2.7/gzip.* ${libdir}/python2.7/zipfile.* ${libdir}/python2.7/tarfile.* ${libdir}/python2.7/lib-dynload/bz2.so "
+
+SUMMARY_${PN}-contextlib="Python utilities for with-statementcontexts."
+RDEPENDS_${PN}-contextlib="${PN}-core"
+FILES_${PN}-contextlib="${libdir}/python${PYTHON_MAJMIN}/contextlib.* "
+
+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 "
+
+SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support"
+RDEPENDS_${PN}-crypt="${PN}-core"
+FILES_${PN}-crypt="${libdir}/python2.7/hashlib.* ${libdir}/python2.7/md5.* ${libdir}/python2.7/sha.* ${libdir}/python2.7/lib-dynload/crypt.so ${libdir}/python2.7/lib-dynload/_hashlib.so ${libdir}/python2.7/lib-dynload/_sha256.so ${libdir}/python2.7/lib-dynload/_sha512.so "
+
+SUMMARY_${PN}-ctypes="Python C types support"
+RDEPENDS_${PN}-ctypes="${PN}-core"
+FILES_${PN}-ctypes="${libdir}/python2.7/ctypes ${libdir}/python2.7/lib-dynload/_ctypes.so ${libdir}/python2.7/lib-dynload/_ctypes_test.so "
+
+SUMMARY_${PN}-curses="Python curses support"
+RDEPENDS_${PN}-curses="${PN}-core"
+FILES_${PN}-curses="${libdir}/python2.7/curses ${libdir}/python2.7/lib-dynload/_curses.so ${libdir}/python2.7/lib-dynload/_curses_panel.so "
+
+SUMMARY_${PN}-datetime="Python calendar and time support"
+RDEPENDS_${PN}-datetime="${PN}-core ${PN}-codecs"
+FILES_${PN}-datetime="${libdir}/python2.7/_strptime.* ${libdir}/python2.7/calendar.* ${libdir}/python2.7/lib-dynload/datetime.so "
+
+SUMMARY_${PN}-db="Python file-based database support"
+RDEPENDS_${PN}-db="${PN}-core"
+FILES_${PN}-db="${libdir}/python2.7/anydbm.* ${libdir}/python2.7/dumbdbm.* ${libdir}/python2.7/whichdb.* "
+
+SUMMARY_${PN}-debugger="Python debugger"
+RDEPENDS_${PN}-debugger="${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint"
+FILES_${PN}-debugger="${libdir}/python2.7/bdb.* ${libdir}/python2.7/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 "
+
+SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects"
+RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re"
+FILES_${PN}-difflib="${libdir}/python2.7/difflib.* "
+
+SUMMARY_${PN}-distutils="Python Distribution Utilities"
+RDEPENDS_${PN}-distutils="${PN}-core ${PN}-email"
+FILES_${PN}-distutils="${libdir}/python2.7/config ${libdir}/python2.7/distutils "
+
+SUMMARY_${PN}-distutils-staticdev="Python distribution utilities (static libraries)"
+RDEPENDS_${PN}-distutils-staticdev="${PN}-distutils"
+FILES_${PN}-distutils-staticdev="${libdir}/python2.7/config/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}/python2.7/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}/python2.7/imaplib.* ${libdir}/python2.7/email "
+
+SUMMARY_${PN}-fcntl="Python's fcntl interface"
+RDEPENDS_${PN}-fcntl="${PN}-core"
+FILES_${PN}-fcntl="${libdir}/python2.7/lib-dynload/fcntl.so "
+
+SUMMARY_${PN}-gdbm="Python GNU database support"
+RDEPENDS_${PN}-gdbm="${PN}-core"
+FILES_${PN}-gdbm="${libdir}/python2.7/lib-dynload/gdbm.so "
+
+SUMMARY_${PN}-hotshot="Python hotshot performance profiler"
+RDEPENDS_${PN}-hotshot="${PN}-core"
+FILES_${PN}-hotshot="${libdir}/python2.7/hotshot ${libdir}/python2.7/lib-dynload/_hotshot.so "
+
+SUMMARY_${PN}-html="Python HTML processing support"
+RDEPENDS_${PN}-html="${PN}-core"
+FILES_${PN}-html="${libdir}/python2.7/formatter.* ${libdir}/python2.7/htmlentitydefs.* ${libdir}/python2.7/htmllib.* ${libdir}/python2.7/markupbase.* ${libdir}/python2.7/sgmllib.* ${libdir}/python2.7/HTMLParser.* "
+
+SUMMARY_${PN}-idle="Python Integrated Development Environment"
+RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter"
+FILES_${PN}-idle="${bindir}/idle ${libdir}/python2.7/idlelib "
+
+SUMMARY_${PN}-image="Python graphical image handling"
+RDEPENDS_${PN}-image="${PN}-core"
+FILES_${PN}-image="${libdir}/python2.7/colorsys.* ${libdir}/python2.7/imghdr.* ${libdir}/python2.7/lib-dynload/imageop.so ${libdir}/python2.7/lib-dynload/rgbimg.so "
+
+SUMMARY_${PN}-importlib="Python import implementation library"
+RDEPENDS_${PN}-importlib="${PN}-core"
+FILES_${PN}-importlib="${libdir}/python2.7/importlib "
+
+SUMMARY_${PN}-io="Python low-level I/O"
+RDEPENDS_${PN}-io="${PN}-core ${PN}-math ${PN}-textutils ${PN}-netclient ${PN}-contextlib"
+FILES_${PN}-io="${libdir}/python2.7/lib-dynload/_socket.so ${libdir}/python2.7/lib-dynload/_io.so ${libdir}/python2.7/lib-dynload/_ssl.so ${libdir}/python2.7/lib-dynload/select.so ${libdir}/python2.7/lib-dynload/termios.so ${libdir}/python2.7/lib-dynload/cStringIO.so ${libdir}/python2.7/pipes.* ${libdir}/python2.7/socket.* ${libdir}/python2.7/ssl.* ${libdir}/python2.7/tempfile.* ${libdir}/python2.7/StringIO.* ${libdir}/python2.7/io.* ${libdir}/python2.7/_pyio.* "
+
+SUMMARY_${PN}-json="Python JSON support"
+RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re ${PN}-codecs"
+FILES_${PN}-json="${libdir}/python2.7/json ${libdir}/python2.7/lib-dynload/_json.so "
+
+SUMMARY_${PN}-lang="Python low-level language support"
+RDEPENDS_${PN}-lang="${PN}-core"
+FILES_${PN}-lang="${libdir}/python2.7/lib-dynload/_bisect.so ${libdir}/python2.7/lib-dynload/_collections.so ${libdir}/python2.7/lib-dynload/_heapq.so ${libdir}/python2.7/lib-dynload/_weakref.so ${libdir}/python2.7/lib-dynload/_functools.so ${libdir}/python2.7/lib-dynload/array.so ${libdir}/python2.7/lib-dynload/itertools.so ${libdir}/python2.7/lib-dynload/operator.so ${libdir}/python2.7/lib-dynload/parser.so ${libdir}/python2.7/atexit.* ${libdir}/python2.7/bisect.* ${libdir}/python2.7/code.* ${libdir}/python2.7/codeop.* ${libdir}/python2.7/collections.* ${libdir}/python2.7/dis.* ${libdir}/python2.7/functools.* ${libdir}/python2.7/heapq.* ${libdir}/python2.7/inspect.* ${libdir}/python2.7/keyword.* ${libdir}/python2.7/opcode.* ${libdir}/python2.7/symbol.* ${libdir}/python2.7/repr.* ${libdir}/python2.7/token.* ${libdir}/python2.7/tokenize.* ${libdir}/python2.7/traceback.* ${libdir}/python2.7/weakref.* "
+
+SUMMARY_${PN}-logging="Python logging support"
+RDEPENDS_${PN}-logging="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold"
+FILES_${PN}-logging="${libdir}/python2.7/logging "
+
+SUMMARY_${PN}-mailbox="Python mailbox format support"
+RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime"
+FILES_${PN}-mailbox="${libdir}/python2.7/mailbox.* "
+
+SUMMARY_${PN}-math="Python math support"
+RDEPENDS_${PN}-math="${PN}-core ${PN}-crypt"
+FILES_${PN}-math="${libdir}/python2.7/lib-dynload/cmath.so ${libdir}/python2.7/lib-dynload/math.so ${libdir}/python2.7/lib-dynload/_random.so ${libdir}/python2.7/random.* ${libdir}/python2.7/sets.* "
+
+SUMMARY_${PN}-mime="Python MIME handling APIs"
+RDEPENDS_${PN}-mime="${PN}-core ${PN}-io"
+FILES_${PN}-mime="${libdir}/python2.7/mimetools.* ${libdir}/python2.7/uu.* ${libdir}/python2.7/quopri.* ${libdir}/python2.7/rfc822.* ${libdir}/python2.7/MimeWriter.* "
+
+SUMMARY_${PN}-mmap="Python memory-mapped file support"
+RDEPENDS_${PN}-mmap="${PN}-core ${PN}-io"
+FILES_${PN}-mmap="${libdir}/python2.7/lib-dynload/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}/python2.7/lib-dynload/_multiprocessing.so ${libdir}/python2.7/multiprocessing "
+
+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}/python2.7/*Cookie*.* ${libdir}/python2.7/base64.* ${libdir}/python2.7/cookielib.* ${libdir}/python2.7/ftplib.* ${libdir}/python2.7/gopherlib.* ${libdir}/python2.7/hmac.* ${libdir}/python2.7/httplib.* ${libdir}/python2.7/mimetypes.* ${libdir}/python2.7/nntplib.* ${libdir}/python2.7/poplib.* ${libdir}/python2.7/smtplib.* ${libdir}/python2.7/telnetlib.* ${libdir}/python2.7/urllib.* ${libdir}/python2.7/urllib2.* ${libdir}/python2.7/urlparse.* ${libdir}/python2.7/uuid.* ${libdir}/python2.7/rfc822.* ${libdir}/python2.7/mimetools.* "
+
+SUMMARY_${PN}-netserver="Python Internet Protocol servers"
+RDEPENDS_${PN}-netserver="${PN}-core ${PN}-netclient ${PN}-shell ${PN}-threading"
+FILES_${PN}-netserver="${libdir}/python2.7/cgi.* ${libdir}/python2.7/*HTTPServer.* ${libdir}/python2.7/SocketServer.* "
+
+SUMMARY_${PN}-numbers="Python number APIs"
+RDEPENDS_${PN}-numbers="${PN}-core ${PN}-lang ${PN}-re"
+FILES_${PN}-numbers="${libdir}/python2.7/decimal.* ${libdir}/python2.7/fractions.* ${libdir}/python2.7/numbers.* "
+
+SUMMARY_${PN}-pickle="Python serialisation/persistence support"
+RDEPENDS_${PN}-pickle="${PN}-core ${PN}-codecs ${PN}-io ${PN}-re"
+FILES_${PN}-pickle="${libdir}/python2.7/pickle.* ${libdir}/python2.7/shelve.* ${libdir}/python2.7/lib-dynload/cPickle.so ${libdir}/python2.7/pickletools.* "
+
+SUMMARY_${PN}-pkgutil="Python package extension utility support"
+RDEPENDS_${PN}-pkgutil="${PN}-core"
+FILES_${PN}-pkgutil="${libdir}/python2.7/pkgutil.* "
+
+SUMMARY_${PN}-plistlib="Generate and parse Mac OS X .plist files"
+RDEPENDS_${PN}-plistlib="${PN}-core ${PN}-datetime ${PN}-io"
+FILES_${PN}-plistlib="${libdir}/python2.7/plistlib.* "
+
+SUMMARY_${PN}-pprint="Python pretty-print support"
+RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io"
+FILES_${PN}-pprint="${libdir}/python2.7/pprint.* "
+
+SUMMARY_${PN}-profile="Python basic performance profiling support"
+RDEPENDS_${PN}-profile="${PN}-core ${PN}-textutils"
+FILES_${PN}-profile="${libdir}/python2.7/profile.* ${libdir}/python2.7/pstats.* ${libdir}/python2.7/cProfile.* ${libdir}/python2.7/lib-dynload/_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}/python2.7/pydoc.* ${libdir}/python2.7/pydoc_data "
+
+SUMMARY_${PN}-re="Python Regular Expression APIs"
+RDEPENDS_${PN}-re="${PN}-core"
+FILES_${PN}-re="${libdir}/python2.7/re.* ${libdir}/python2.7/sre.* ${libdir}/python2.7/sre_compile.* ${libdir}/python2.7/sre_constants* ${libdir}/python2.7/sre_parse.* "
+
+SUMMARY_${PN}-readline="Python readline support"
+RDEPENDS_${PN}-readline="${PN}-core"
+FILES_${PN}-readline="${libdir}/python2.7/lib-dynload/readline.so ${libdir}/python2.7/rlcompleter.* "
+
+SUMMARY_${PN}-resource="Python resource control interface"
+RDEPENDS_${PN}-resource="${PN}-core"
+FILES_${PN}-resource="${libdir}/python2.7/lib-dynload/resource.so "
+
+SUMMARY_${PN}-robotparser="Python robots.txt parser"
+RDEPENDS_${PN}-robotparser="${PN}-core ${PN}-netclient"
+FILES_${PN}-robotparser="${libdir}/python2.7/robotparser.* "
+
+SUMMARY_${PN}-shell="Python shell-like functionality"
+RDEPENDS_${PN}-shell="${PN}-core ${PN}-re"
+FILES_${PN}-shell="${libdir}/python2.7/cmd.* ${libdir}/python2.7/commands.* ${libdir}/python2.7/dircache.* ${libdir}/python2.7/fnmatch.* ${libdir}/python2.7/glob.* ${libdir}/python2.7/popen2.* ${libdir}/python2.7/shlex.* ${libdir}/python2.7/shutil.* "
+
+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}/python2.7/smtpd.* "
+
+SUMMARY_${PN}-sqlite3="Python Sqlite3 database support"
+RDEPENDS_${PN}-sqlite3="${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading ${PN}-zlib"
+FILES_${PN}-sqlite3="${libdir}/python2.7/lib-dynload/_sqlite3.so ${libdir}/python2.7/sqlite3/dbapi2.* ${libdir}/python2.7/sqlite3/__init__.* ${libdir}/python2.7/sqlite3/dump.* "
+
+SUMMARY_${PN}-sqlite3-tests="Python Sqlite3 database support tests"
+RDEPENDS_${PN}-sqlite3-tests="${PN}-core ${PN}-sqlite3"
+FILES_${PN}-sqlite3-tests="${libdir}/python2.7/sqlite3/test "
+
+SUMMARY_${PN}-stringold="Python string APIs [deprecated]"
+RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re"
+FILES_${PN}-stringold="${libdir}/python2.7/lib-dynload/strop.so ${libdir}/python2.7/string.* ${libdir}/python2.7/stringold.* "
+
+SUMMARY_${PN}-subprocess="Python subprocess support"
+RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle"
+FILES_${PN}-subprocess="${libdir}/python2.7/subprocess.* "
+
+SUMMARY_${PN}-syslog="Python syslog interface"
+RDEPENDS_${PN}-syslog="${PN}-core"
+FILES_${PN}-syslog="${libdir}/python2.7/lib-dynload/syslog.so "
+
+SUMMARY_${PN}-terminal="Python terminal controlling support"
+RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io"
+FILES_${PN}-terminal="${libdir}/python2.7/pty.* ${libdir}/python2.7/tty.* "
+
+SUMMARY_${PN}-tests="Python tests"
+RDEPENDS_${PN}-tests="${PN}-core"
+FILES_${PN}-tests="${libdir}/python2.7/test "
+
+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}/python2.7/lib-dynload/_csv.so ${libdir}/python2.7/csv.* ${libdir}/python2.7/optparse.* ${libdir}/python2.7/textwrap.* "
+
+SUMMARY_${PN}-threading="Python threading & synchronization support"
+RDEPENDS_${PN}-threading="${PN}-core ${PN}-lang"
+FILES_${PN}-threading="${libdir}/python2.7/_threading_local.* ${libdir}/python2.7/dummy_thread.* ${libdir}/python2.7/dummy_threading.* ${libdir}/python2.7/mutex.* ${libdir}/python2.7/threading.* ${libdir}/python2.7/Queue.* "
+
+SUMMARY_${PN}-tkinter="Python Tcl/Tk bindings"
+RDEPENDS_${PN}-tkinter="${PN}-core"
+FILES_${PN}-tkinter="${libdir}/python2.7/lib-dynload/_tkinter.so ${libdir}/python2.7/lib-tk "
+
+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}/python2.7/unittest/ "
+
+SUMMARY_${PN}-unixadmin="Python Unix administration support"
+RDEPENDS_${PN}-unixadmin="${PN}-core"
+FILES_${PN}-unixadmin="${libdir}/python2.7/lib-dynload/nis.so ${libdir}/python2.7/lib-dynload/grp.so ${libdir}/python2.7/lib-dynload/pwd.so ${libdir}/python2.7/getpass.* "
+
+SUMMARY_${PN}-xml="Python basic XML support"
+RDEPENDS_${PN}-xml="${PN}-core ${PN}-re"
+FILES_${PN}-xml="${libdir}/python2.7/lib-dynload/_elementtree.so ${libdir}/python2.7/lib-dynload/pyexpat.so ${libdir}/python2.7/xml ${libdir}/python2.7/xmllib.* "
+
+SUMMARY_${PN}-xmlrpc="Python XML-RPC support"
+RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang"
+FILES_${PN}-xmlrpc="${libdir}/python2.7/xmlrpclib.* ${libdir}/python2.7/SimpleXMLRPCServer.* ${libdir}/python2.7/DocXMLRPCServer.* "
+
+SUMMARY_${PN}-zlib="Python zlib compression support"
+RDEPENDS_${PN}-zlib="${PN}-core"
+FILES_${PN}-zlib="${libdir}/python2.7/lib-dynload/zlib.so "
+
+SUMMARY_${PN}-modules="All Python modules"
+RDEPENDS_${PN}-modules="${PN}-2to3 ${PN}-argparse ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-contextlib ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-difflib ${PN}-distutils ${PN}-doctest ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-hotshot ${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}-plistlib ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${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}-zlib "
+ALLOW_EMPTY_${PN}-modules = "1"
+
+
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
new file mode 100644
index 000000000..335c3ffdb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc
@@ -0,0 +1,264 @@
+
+# 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}-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}-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}-shell ${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 "
+
+PACKAGES="${PN}-dbg ${PN}-2to3 ${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}-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}-shell ${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"
+
+SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator"
+RDEPENDS_${PN}-2to3="${PN}-core"
+FILES_${PN}-2to3="${libdir}/python3.5/lib2to3 "
+
+SUMMARY_${PN}-asyncio="Python Asynchronous I/O, event loop, coroutines and tasks"
+RDEPENDS_${PN}-asyncio="${PN}-core"
+FILES_${PN}-asyncio="${libdir}/python3.5/asyncio "
+
+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.* "
+
+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.* "
+
+SUMMARY_${PN}-compile="Python bytecode compilation support"
+RDEPENDS_${PN}-compile="${PN}-core"
+FILES_${PN}-compile="${libdir}/python3.5/py_compile.* ${libdir}/python3.5/compileall.* "
+
+SUMMARY_${PN}-compression="Python high-level compression support"
+RDEPENDS_${PN}-compression="${PN}-core ${PN}-codecs"
+FILES_${PN}-compression="${libdir}/python3.5/gzip.* ${libdir}/python3.5/zipfile.* ${libdir}/python3.5/tarfile.* ${libdir}/python3.5/lib-dynload/bz2.*.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 "
+
+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 "
+
+SUMMARY_${PN}-ctypes="Python C types support"
+RDEPENDS_${PN}-ctypes="${PN}-core"
+FILES_${PN}-ctypes="${libdir}/python3.5/ctypes ${libdir}/python3.5/lib-dynload/_ctypes.*.so ${libdir}/python3.5/lib-dynload/_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 "
+
+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/lib-dynload/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 "
+
+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.* "
+
+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 "
+
+SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects"
+RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re"
+FILES_${PN}-difflib="${libdir}/python3.5/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 "
+
+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 "
+
+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.* "
+
+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 "
+
+SUMMARY_${PN}-fcntl="Python's fcntl interface"
+RDEPENDS_${PN}-fcntl="${PN}-core"
+FILES_${PN}-fcntl="${libdir}/python3.5/lib-dynload/fcntl.*.so "
+
+SUMMARY_${PN}-gdbm="Python GNU database support"
+RDEPENDS_${PN}-gdbm="${PN}-core"
+FILES_${PN}-gdbm="${libdir}/python3.5/lib-dynload/_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.* "
+
+SUMMARY_${PN}-idle="Python Integrated Development Environment"
+RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter"
+FILES_${PN}-idle="${bindir}/idle ${libdir}/python3.5/idlelib "
+
+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 "
+
+SUMMARY_${PN}-importlib="Python import implementation library"
+RDEPENDS_${PN}-importlib="${PN}-core"
+FILES_${PN}-importlib="${libdir}/python3.5/importlib "
+
+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.* "
+
+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 "
+
+SUMMARY_${PN}-lang="Python low-level language support"
+RDEPENDS_${PN}-lang="${PN}-core"
+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/dis.* ${libdir}/python3.5/functools.* ${libdir}/python3.5/heapq.* ${libdir}/python3.5/inspect.* ${libdir}/python3.5/keyword.* ${libdir}/python3.5/opcode.* ${libdir}/python3.5/symbol.* ${libdir}/python3.5/repr.* ${libdir}/python3.5/token.* ${libdir}/python3.5/tokenize.* ${libdir}/python3.5/traceback.* ${libdir}/python3.5/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 "
+
+SUMMARY_${PN}-mailbox="Python mailbox format support"
+RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime"
+FILES_${PN}-mailbox="${libdir}/python3.5/mailbox.* "
+
+SUMMARY_${PN}-math="Python math support"
+RDEPENDS_${PN}-math="${PN}-core"
+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.* "
+
+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.* "
+
+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 "
+
+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 "
+
+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.* "
+
+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.* "
+
+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.* "
+
+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.* "
+
+SUMMARY_${PN}-pkgutil="Python package extension utility support"
+RDEPENDS_${PN}-pkgutil="${PN}-core"
+FILES_${PN}-pkgutil="${libdir}/python3.5/pkgutil.* "
+
+SUMMARY_${PN}-pprint="Python pretty-print support"
+RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io"
+FILES_${PN}-pprint="${libdir}/python3.5/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 "
+
+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 "
+
+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.* "
+
+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.* "
+
+SUMMARY_${PN}-reprlib="Python alternate repr() implementation"
+RDEPENDS_${PN}-reprlib="${PN}-core"
+FILES_${PN}-reprlib="${libdir}/python3.5/reprlib.py "
+
+SUMMARY_${PN}-resource="Python resource control interface"
+RDEPENDS_${PN}-resource="${PN}-core"
+FILES_${PN}-resource="${libdir}/python3.5/lib-dynload/resource.*.so "
+
+SUMMARY_${PN}-shell="Python shell-like functionality"
+RDEPENDS_${PN}-shell="${PN}-core ${PN}-re"
+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.* "
+
+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.* "
+
+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.* "
+
+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 "
+
+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.* "
+
+SUMMARY_${PN}-subprocess="Python subprocess support"
+RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle"
+FILES_${PN}-subprocess="${libdir}/python3.5/subprocess.* "
+
+SUMMARY_${PN}-syslog="Python syslog interface"
+RDEPENDS_${PN}-syslog="${PN}-core"
+FILES_${PN}-syslog="${libdir}/python3.5/lib-dynload/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.* "
+
+SUMMARY_${PN}-tests="Python tests"
+RDEPENDS_${PN}-tests="${PN}-core"
+FILES_${PN}-tests="${libdir}/python3.5/test "
+
+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.* "
+
+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.* "
+
+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 "
+
+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/ "
+
+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.* "
+
+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.* "
+
+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 "
+
+SUMMARY_${PN}-modules="All Python modules"
+RDEPENDS_${PN}-modules="${PN}-2to3 ${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}-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}-shell ${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 "
+ALLOW_EMPTY_${PN}-modules = "1"
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-async_0.6.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-async_0.6.2.bb
new file mode 100644
index 000000000..ad0a61776
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-async_0.6.2.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Python framework to process interdependent tasks in a pool of workers"
+HOMEPAGE = "http://github.com/gitpython-developers/async"
+SECTION = "devel/python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=88df8e78b9edfd744953862179f2d14e"
+
+SRC_URI = "http://pypi.python.org/packages/source/a/async/async-${PV}.tar.gz"
+SRC_URI[md5sum] = "9b06b5997de2154f3bc0273f80bcef6b"
+SRC_URI[sha256sum] = "ac6894d876e45878faae493b0cf61d0e28ec417334448ac0a6ea2229d8343051"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/async/"
+
+S = "${WORKDIR}/async-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} += "python-threading python-lang"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-dbus_1.2.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-dbus_1.2.0.bb
new file mode 100644
index 000000000..b314dce1c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-dbus_1.2.0.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Python bindings for the DBus inter-process communication system"
+SECTION = "devel/python"
+HOMEPAGE = "http://www.freedesktop.org/Software/dbus"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0b83047ce9e948b67c0facc5f233476a"
+DEPENDS = "expat dbus dbus-glib virtual/libintl python-pyrex-native"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-${PV}.tar.gz \
+"
+
+SRC_URI[md5sum] = "b09cd2d1a057cc432ce944de3fc06bf7"
+SRC_URI[sha256sum] = "e12c6c8b2bf3a9302f75166952cbe41d6b38c3441bbc6767dbd498942316c6df"
+S = "${WORKDIR}/dbus-python-${PV}"
+
+inherit distutils-base autotools pkgconfig
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[docs] = "--enable-html-docs,--disable-html-docs,python-docutils-native"
+PACKAGECONFIG[api-docs] = "--enable-api-docs,--disable-api-docs,python-docutils-native python-epydoc-native"
+
+export BUILD_SYS
+export HOST_SYS
+
+export STAGING_LIBDIR
+export STAGING_INCDIR
+
+RDEPENDS_${PN} = "python-io python-logging python-stringold python-threading python-xml"
+
+FILES_${PN}-dev += "${libdir}/pkgconfig"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-docutils_0.12.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-docutils_0.12.bb
new file mode 100644
index 000000000..8cda88d27
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-docutils_0.12.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=a722fbdc20347db7b69223594dd54574"
+
+DEPENDS = "python"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/docutils/docutils-${PV}.tar.gz"
+SRC_URI[md5sum] = "4622263b62c5c771c03502afa3157768"
+SRC_URI[sha256sum] = "c7db717810ab6965f66c8cf0398a98c9d8df982da39b4cd7f162911eb89596fa"
+
+S = "${WORKDIR}/docutils-${PV}"
+
+inherit distutils
+
+BBCLASSEXTEND = "native"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-git_1.0.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-git_1.0.2.bb
new file mode 100644
index 000000000..f00f805a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-git_1.0.2.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Python library used to interact with Git repositories"
+DESCRIPTION = "GitPython provides object model read and write access to \
+a git repository. Access repository information conveniently, alter the \
+index directly, handle remotes, or go down to low-level object database \
+access with big-files support."
+HOMEPAGE = "http://github.com/gitpython-developers/GitPython"
+SECTION = "devel/python"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8b8d26c37c1d5a04f9b0186edbebc183"
+DEPENDS = "python-gitdb"
+
+SRC_URI = "http://pypi.python.org/packages/source/G/GitPython/GitPython-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "d92d96a8da0fc77cf141d3e16084e094"
+SRC_URI[sha256sum] = "85de72556781480a38897a77de5b458ae3838b0fd589593679a1b5f34d181d84"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/GitPython/"
+UPSTREAM_CHECK_REGEX = "/GitPython/(?P<pver>(\d+[\.\-_]*)+)"
+
+S = "${WORKDIR}/GitPython-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} += "python-gitdb python-lang python-io python-shell python-math python-re python-subprocess python-stringold python-unixadmin"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-gitdb_0.6.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-gitdb_0.6.4.bb
new file mode 100644
index 000000000..c82df1ef7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-gitdb_0.6.4.bb
@@ -0,0 +1,21 @@
+SUMMARY = "A pure-Python git object database"
+HOMEPAGE = "http://github.com/gitpython-developers/gitdb"
+SECTION = "devel/python"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=59e5ecb13339a936eedf83282eaf4528"
+DEPENDS = "python-async python-smmap"
+
+SRC_URI = "https://pypi.python.org/packages/source/g/gitdb/gitdb-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "44e4366b8bdfd306b075c3a52c96ae1a"
+SRC_URI[sha256sum] = "a3ebbc27be035a2e874ed904df516e35f4a29a778a764385de09de9e0f139658"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/gitdb/"
+
+S = "${WORKDIR}/gitdb-${PV}"
+
+inherit distutils
+
+RDEPENDS_${PN} += "python-smmap python-async python-mmap python-lang python-zlib python-io python-shell"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch
new file mode 100644
index 000000000..2575306be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch
@@ -0,0 +1,55 @@
+From 07d4f095a9e22ae676a8d68073101131e65012dc Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Tue, 15 Nov 2011 13:16:54 +0100
+Subject: [PATCH] python imaging setup.py: force paths for zlib, freetype and jpeg and don't add host paths
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ setup.py | 14 +++-----------
+ 1 files changed, 3 insertions(+), 11 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 5d4d53a..b1a22ec 100644
+--- a/setup.py
++++ b/setup.py
+@@ -34,10 +34,10 @@ def libinclude(root):
+ # TIFF_ROOT = libinclude("/opt/tiff")
+
+ TCL_ROOT = None
+-JPEG_ROOT = None
+-ZLIB_ROOT = None
++JPEG_ROOT = os.environ['STAGING_LIBDIR']
++ZLIB_ROOT = os.environ['STAGING_LIBDIR']
+ TIFF_ROOT = None
+-FREETYPE_ROOT = None
++FREETYPE_ROOT = os.environ['STAGING_LIBDIR'], os.environ['STAGING_INCDIR']
+ LCMS_ROOT = None
+
+ # FIXME: add mechanism to explicitly *disable* the use of a library
+@@ -147,7 +147,6 @@ class pil_build_ext(build_ext):
+ add_directory(library_dirs, "/opt/local/lib")
+ add_directory(include_dirs, "/opt/local/include")
+
+- add_directory(library_dirs, "/usr/local/lib")
+ # FIXME: check /opt/stuff directories here?
+
+ prefix = sysconfig.get_config_var("prefix")
+@@ -207,13 +206,6 @@ class pil_build_ext(build_ext):
+ if os.path.isfile(os.path.join(tcl_dir, "tk.h")):
+ add_directory(include_dirs, tcl_dir)
+
+- # standard locations
+- add_directory(library_dirs, "/usr/local/lib")
+- add_directory(include_dirs, "/usr/local/include")
+-
+- add_directory(library_dirs, "/usr/lib")
+- add_directory(include_dirs, "/usr/include")
+-
+ #
+ # insert new dirs *before* default libs, to avoid conflicts
+ # between Python PYD stub libs and real libraries
+--
+1.7.2.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch
new file mode 100644
index 000000000..4960ed466
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch
@@ -0,0 +1,65 @@
+At least lcms wasn't deterministicly detected from sysroot.
+
+This will allow to export LCMS_ENABLED=False when lcms isn't in PACKAGECONFIG.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+diff -uNr Imaging-1.1.7.orig/setup.py Imaging-1.1.7/setup.py
+--- Imaging-1.1.7.orig/setup.py 2013-07-22 10:17:02.081457075 +0200
++++ Imaging-1.1.7/setup.py 2013-07-22 13:10:09.029707492 +0200
+@@ -39,6 +39,12 @@
+ TIFF_ROOT = None
+ FREETYPE_ROOT = os.environ['STAGING_LIBDIR'], os.environ['STAGING_INCDIR']
+ LCMS_ROOT = None
++TCL_ENABLED = os.getenv('TCL_ENABLED', "True")
++JPEG_ENABLED = os.getenv('JPEG_ENABLED', "True")
++ZLIB_ENABLED = os.getenv('ZLIB_ENABLED', "True")
++TIFF_ENABLED = os.getenv('TIFF_ENABLED', "True")
++FREETYPE_ENABLED = os.getenv('FREETYPE_ENABLED', "True")
++LCMS_ENABLED = os.getenv('LCMS_ENABLED', "True")
+
+ # FIXME: add mechanism to explicitly *disable* the use of a library
+
+@@ -220,22 +226,22 @@
+ zlib = jpeg = tiff = freetype = tcl = tk = lcms = None
+ feature = feature()
+
+- if find_include_file(self, "zlib.h"):
++ if ZLIB_ENABLED == 'True' and find_include_file(self, "zlib.h"):
+ if find_library_file(self, "z"):
+ feature.zlib = "z"
+ elif sys.platform == "win32" and find_library_file(self, "zlib"):
+ feature.zlib = "zlib" # alternative name
+
+- if find_include_file(self, "jpeglib.h"):
++ if JPEG_ENABLED == 'True' and find_include_file(self, "jpeglib.h"):
+ if find_library_file(self, "jpeg"):
+ feature.jpeg = "jpeg"
+ elif sys.platform == "win32" and find_library_file(self, "libjpeg"):
+ feature.jpeg = "libjpeg" # alternative name
+
+- if find_library_file(self, "tiff"):
++ if TIFF_ENABLED == 'True' and find_library_file(self, "tiff"):
+ feature.tiff = "tiff"
+
+- if find_library_file(self, "freetype"):
++ if FREETYPE_ENABLED == 'True' and find_library_file(self, "freetype"):
+ # look for freetype2 include files
+ freetype_version = 0
+ for dir in self.compiler.include_dirs:
+@@ -256,11 +262,11 @@
+ if dir:
+ add_directory(self.compiler.include_dirs, dir, 0)
+
+- if find_include_file(self, "lcms.h"):
++ if LCMS_ENABLED == 'True' and find_include_file(self, "lcms.h"):
+ if find_library_file(self, "lcms"):
+ feature.lcms = "lcms"
+
+- if _tkinter and find_include_file(self, "tk.h"):
++ if TCL_ENABLED == 'True' and _tkinter and find_include_file(self, "tk.h"):
+ # the library names may vary somewhat (e.g. tcl84 or tcl8.4)
+ version = TCL_VERSION[0] + TCL_VERSION[2]
+ if find_library_file(self, "tcl" + version):
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch
new file mode 100644
index 000000000..9ecc63a0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From c6040f618d8f2706a7b46d1cdf37d1a587f9701f Mon Sep 17 00:00:00 2001
+From: Andrew Stromnov <stromnov@gmail.com>
+Date: Thu, 28 Nov 2013 16:58:43 +0400
+Subject: [PATCH] fix compiling with FreeType 2.5.1
+
+---
+ _imagingft.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/_imagingft.c b/_imagingft.c
+index 47d50bd..f19555b 100644
+--- a/_imagingft.c
++++ b/_imagingft.c
+@@ -59,7 +59,11 @@ struct {
+ const char* message;
+ } ft_errors[] =
+
++#if defined(USE_FREETYPE_2_1)
++#include FT_ERRORS_H
++#else
+ #include <freetype/fterrors.h>
++#endif
+
+ /* -------------------------------------------------------------------- */
+ /* font objects */
+--
+1.8.5.1
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging_1.1.7.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging_1.1.7.bb
new file mode 100644
index 000000000..a67832827
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-imaging_1.1.7.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Python Imaging Library (PIL)"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://README;beginline=92;endline=120;md5=c4371af4579f1e489cf881c1443dd4ec"
+DEPENDS = "freetype jpeg tiff"
+SRCNAME = "Imaging"
+PR = "r5"
+
+SRC_URI = "http://effbot.org/downloads/Imaging-${PV}.tar.gz \
+ file://0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch \
+ file://allow.to.disable.some.features.patch \
+ file://fix-freetype-includes.patch"
+
+SRC_URI[md5sum] = "fc14a54e1ce02a0225be8854bfba478e"
+SRC_URI[sha256sum] = "895bc7c2498c8e1f9b99938f1a40dc86b3f149741f105cf7c7bd2e0725405211"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+# There isn't enable/disable option, and lcms is in meta-oe, at least make it explicit when enabled
+# setup.py already has FIXME: add mechanism to explicitly *disable* the use of a library
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lcms] = ",,lcms"
+
+inherit distutils
+
+do_compile() {
+ export STAGING_LIBDIR=${STAGING_LIBDIR}
+ export STAGING_INCDIR=${STAGING_INCDIR}
+ export LCMS_ENABLED=${@bb.utils.contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)}
+ distutils_do_compile
+}
+
+do_install() {
+ export STAGING_LIBDIR=${STAGING_LIBDIR}
+ export STAGING_INCDIR=${STAGING_INCDIR}
+ export LCMS_ENABLED=${@bb.utils.contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)}
+ distutils_do_install
+ install -d ${D}${datadir}/doc/${BPN}/html/
+ install -m 0644 ${S}/README ${D}${datadir}/doc/${BPN}/
+ install -m 0644 ${S}/Docs/* ${D}${datadir}/doc/${BPN}/html/
+
+ # get rid of #!/usr/local/bin/python
+ sed -i -e 's:/usr/local/bin/:${bindir}/env :g' ${D}${bindir}/*
+}
+
+RDEPENDS_${PN} += "python-lang python-stringold"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-mako_1.0.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-mako_1.0.3.bb
new file mode 100644
index 000000000..9efd700dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-mako_1.0.3.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Templating library for Python"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=deb3ff8e4c17aaf7b80889b6b2bf4c83"
+
+SRC_URI = "https://pypi.python.org/packages/source/M/Mako/Mako-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "a78f20f6366a8a0659ce5532f8614e53"
+SRC_URI[sha256sum] = "7644bc0ee35965d2e146dde31827b8982ed70a58281085fac42869a09764d38c"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/mako/"
+UPSTREAM_CHECK_REGEX = "/Mako/(?P<pver>(\d+[\.\-_]*)+)"
+
+S = "${WORKDIR}/Mako-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} = "python-threading \
+ python-netclient \
+ python-html \
+"
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
new file mode 100644
index 000000000..a39247ce7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+# Some versions of SWIG do not use the extension parameter.
+# Make it optional.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+Index: Python-2.6.1/Lib/distutils/command/build_ext.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/command/build_ext.py
++++ Python-2.6.1/Lib/distutils/command/build_ext.py
+@@ -566,7 +566,7 @@ class build_ext (Command):
+ target_lang=language)
+
+
+- def swig_sources (self, sources, extension):
++ def swig_sources (self, sources, extension=None):
+
+ """Walk the list of source files in 'sources', looking for SWIG
+ interface (.i) files. Run SWIG on all that are found, and
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
new file mode 100644
index 000000000..c92469b9b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+# Don't modify the she-bang line for a cross-build.
+# Otherwise it points to our hostpython (which we do not want)
+#
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+
+Index: Python-2.6.1/Lib/distutils/command/build_scripts.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/command/build_scripts.py
++++ Python-2.6.1/Lib/distutils/command/build_scripts.py
+@@ -87,7 +87,7 @@ class build_scripts (Command):
+ continue
+
+ match = first_line_re.match(first_line)
+- if match:
++ if False: #match:
+ adjust = 1
+ post_interp = match.group(1) or ''
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
new file mode 100644
index 000000000..f89aaff7b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
@@ -0,0 +1,65 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+# The proper prefix is inside our staging area.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+# Signed-off-by: Phil Blundell <philb@gnu.org>
+
+--- Python-2.6.6/Lib/distutils/sysconfig.py.orig 2012-01-03 14:02:03.027005296 +0000
++++ Python-2.6.6/Lib/distutils/sysconfig.py 2012-01-03 14:02:31.517601081 +0000
+@@ -19,8 +19,8 @@
+ from distutils.errors import DistutilsPlatformError
+
+ # These are needed in a couple of spots, so just compute them once.
+-PREFIX = os.path.normpath(sys.prefix)
+-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
++PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+
+ # Path to the base directory of the project. On Windows the binary may
+ # live in project/PCBuild9. If we're dealing with an x64 Windows build,
+@@ -70,7 +70,7 @@
+ sys.exec_prefix -- i.e., ignore 'plat_specific'.
+ """
+ if prefix is None:
+- prefix = plat_specific and EXEC_PREFIX or PREFIX
++ prefix = os.environ['STAGING_INCDIR'].rstrip('include')
+
+ if os.name == "posix":
+ if python_build:
+@@ -115,12 +115,16 @@
+ If 'prefix' is supplied, use it instead of sys.prefix or
+ sys.exec_prefix -- i.e., ignore 'plat_specific'.
+ """
++ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
+ if prefix is None:
+- prefix = plat_specific and EXEC_PREFIX or PREFIX
++ if plat_specific:
++ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
++ else:
++ prefix = PREFIX
+
+ if os.name == "posix":
+ libpython = os.path.join(prefix,
+- "lib", "python" + get_python_version())
++ lib_basename, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+@@ -216,7 +220,7 @@
+ else:
+ # The name of the config.h file changed in 2.2
+ config_h = 'pyconfig.h'
+- return os.path.join(inc_dir, config_h)
++ return os.path.join(inc_dir, config_h).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+
+
+ def get_makefile_filename():
+@@ -225,7 +229,7 @@
+ return os.path.join(os.path.dirname(os.path.realpath(sys.executable)),
+ "Makefile")
+ lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
+- return os.path.join(lib_dir, "config", "Makefile")
++ return os.path.join(lib_dir, "config", "Makefile").replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+
+
+ def parse_config_h(fp, g=None):
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
new file mode 100644
index 000000000..5279e7c3b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/avoid_parallel_make_races_on_pgen.patch
@@ -0,0 +1,27 @@
+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/debug.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/debug.patch
new file mode 100644
index 000000000..5ec10d6b2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/debug.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+Index: Python-2.6.1/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/unixccompiler.py 2009-11-13 16:04:54.000000000 +0000
++++ Python-2.6.1/Lib/distutils/unixccompiler.py 2009-11-13 16:06:27.000000000 +0000
+@@ -300,6 +300,8 @@
+ dylib_f = self.library_filename(lib, lib_type='dylib')
+ static_f = self.library_filename(lib, lib_type='static')
+
++ print "Looking in %s for %s" % (lib, dirs)
++
+ for dir in dirs:
+ shared = os.path.join(dir, shared_f)
+ dylib = os.path.join(dir, dylib_f)
+@@ -309,10 +311,13 @@
+ # assuming that *all* Unix C compilers do. And of course I'm
+ # ignoring even GCC's "-static" option. So sue me.
+ if os.path.exists(dylib):
++ print "Found %s" % (dylib)
+ return dylib
+ elif os.path.exists(shared):
++ print "Found %s" % (shared)
+ return shared
+ elif os.path.exists(static):
++ print "Found %s" % (static)
+ return static
+
+ # Oops, didn't find it in *any* of 'dirs'
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
new file mode 100644
index 000000000..8ca89e7c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/multilib.patch
@@ -0,0 +1,235 @@
+Rebased for Python 2.7.9
+
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+2011/09/29
+The python recipe building was failing because python-native
+could not handle sys.lib var. sys.lib var is defined in the
+multilib patch hence added this multilib.patch for python-native
+recipe.
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Index: Python-2.7.9/Include/pythonrun.h
+===================================================================
+--- Python-2.7.9.orig/Include/pythonrun.h
++++ Python-2.7.9/Include/pythonrun.h
+@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
+ /* In their own files */
+ PyAPI_FUNC(const char *) Py_GetVersion(void);
+ PyAPI_FUNC(const char *) Py_GetPlatform(void);
++PyAPI_FUNC(const char *) Py_GetLib(void);
+ 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.9/Lib/distutils/command/install.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/command/install.py
++++ Python-2.7.9/Lib/distutils/command/install.py
+@@ -22,6 +22,8 @@ from site import USER_BASE
+ from site import USER_SITE
+
+
++libname = sys.lib
++
+ if sys.version < "2.2":
+ WINDOWS_SCHEME = {
+ 'purelib': '$base',
+@@ -42,7 +44,7 @@ else:
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+ 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
++ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+Index: Python-2.7.9/Lib/pydoc.py
+===================================================================
+--- Python-2.7.9.orig/Lib/pydoc.py
++++ Python-2.7.9/Lib/pydoc.py
+@@ -383,7 +383,7 @@ class Doc:
+
+ 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.9/Lib/site.py
+===================================================================
+--- Python-2.7.9.orig/Lib/site.py
++++ Python-2.7.9/Lib/site.py
+@@ -288,13 +288,19 @@ def getsitepackages():
+ if sys.platform in ('os2emx', 'riscos'):
+ sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
+ elif os.sep == '/':
+- sitepackages.append(os.path.join(prefix, "lib",
++ sitepackages.append(os.path.join(prefix, sys.lib,
+ "python" + sys.version[:3],
+ "site-packages"))
+- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
++ if sys.lib != "lib":
++ sitepackages.append(os.path.join(prefix, "lib",
++ "python" + sys.version[:3],
++ "site-packages"))
++ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
++ if sys.lib != "lib":
++ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
+ else:
+ 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.9/Lib/test/test_dl.py
+===================================================================
+--- Python-2.7.9.orig/Lib/test/test_dl.py
++++ Python-2.7.9/Lib/test/test_dl.py
+@@ -4,10 +4,11 @@
+ import unittest
+ from test.test_support import verbose, import_module
+ dl = import_module('dl', deprecated=True)
++import sys
+
+ sharedlibs = [
+- ('/usr/lib/libc.so', 'getpid'),
+- ('/lib/libc.so.6', 'getpid'),
++ ('/usr/'+sys.lib+'/libc.so', 'getpid'),
++ ('/'+sys.lib+'/libc.so.6', 'getpid'),
+ ('/usr/bin/cygwin1.dll', 'getpid'),
+ ('/usr/lib/libc.dylib', 'getpid'),
+ ]
+Index: Python-2.7.9/Lib/trace.py
+===================================================================
+--- Python-2.7.9.orig/Lib/trace.py
++++ Python-2.7.9/Lib/trace.py
+@@ -754,10 +754,10 @@ def main(argv=None):
+ # should I also call expanduser? (after all, could use $HOME)
+
+ s = s.replace("$prefix",
+- os.path.join(sys.prefix, "lib",
++ os.path.join(sys.prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = s.replace("$exec_prefix",
+- os.path.join(sys.exec_prefix, "lib",
++ os.path.join(sys.exec_prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = os.path.normpath(s)
+ ignore_dirs.append(s)
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -87,6 +87,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
+
+ # Machine-dependent subdirectories
+ MACHDEP= @MACHDEP@
++LIB= @LIB@
+
+ # Multiarch directory (may be empty)
+ MULTIARCH= @MULTIARCH@
+@@ -106,7 +107,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/@LIB@
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+@@ -597,6 +598,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
+ -DEXEC_PREFIX='"$(exec_prefix)"' \
+ -DVERSION='"$(VERSION)"' \
+ -DVPATH='"$(VPATH)"' \
++ -DLIB='"$(LIB)"' \
+ -o $@ $(srcdir)/Modules/getpath.c
+
+ Modules/python.o: $(srcdir)/Modules/python.c
+@@ -639,7 +641,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
+- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
++ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
+
+ Python/importdl.o: $(srcdir)/Python/importdl.c
+ $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+Index: Python-2.7.9/Modules/getpath.c
+===================================================================
+--- Python-2.7.9.orig/Modules/getpath.c
++++ Python-2.7.9/Modules/getpath.c
+@@ -116,9 +116,11 @@
+ #define EXEC_PREFIX PREFIX
+ #endif
+
++#define LIB_PYTHON LIB "/python" VERSION
++
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
+ #endif
+
+ #ifndef LANDMARK
+@@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = LIB_PYTHON;
+
+ static void
+ reduce(char *dir)
+Index: Python-2.7.9/Python/getplatform.c
+===================================================================
+--- Python-2.7.9.orig/Python/getplatform.c
++++ Python-2.7.9/Python/getplatform.c
+@@ -10,3 +10,13 @@ Py_GetPlatform(void)
+ {
+ return PLATFORM;
+ }
++
++#ifndef LIB
++#define LIB "lib"
++#endif
++
++const char *
++Py_GetLib(void)
++{
++ return LIB;
++}
+Index: Python-2.7.9/Python/sysmodule.c
+===================================================================
+--- Python-2.7.9.orig/Python/sysmodule.c
++++ Python-2.7.9/Python/sysmodule.c
+@@ -1437,6 +1437,8 @@ _PySys_Init(void)
+ PyString_FromString(Py_GetCopyright()));
+ SET_SYS_FROM_STRING("platform",
+ PyString_FromString(Py_GetPlatform()));
++ SET_SYS_FROM_STRING("lib",
++ PyString_FromString(Py_GetLib()));
+ SET_SYS_FROM_STRING("executable",
+ PyString_FromString(Py_GetProgramFullPath()));
+ SET_SYS_FROM_STRING("prefix",
+Index: Python-2.7.9/configure.ac
+===================================================================
+--- Python-2.7.9.orig/configure.ac
++++ Python-2.7.9/configure.ac
+@@ -736,6 +736,11 @@ SunOS*)
+ ;;
+ esac
+
++AC_SUBST(LIB)
++AC_MSG_CHECKING(LIB)
++LIB=`basename ${libdir}`
++AC_MSG_RESULT($LIB)
++
+
+ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/nohostlibs.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/nohostlibs.patch
new file mode 100644
index 000000000..8a452e94d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/nohostlibs.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+2014/12/15
+Rebased for python-2.7.9
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/setup.py
+===================================================================
+--- Python-2.7.9.orig/setup.py
++++ Python-2.7.9/setup.py
+@@ -439,9 +439,9 @@ class PyBuildExt(build_ext):
+
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+- if not cross_compiling:
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
++ # if not cross_compiling:
++ # add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ # add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ if cross_compiling:
+ self.add_gcc_paths()
+ self.add_multiarch_paths()
+@@ -480,15 +480,15 @@ class PyBuildExt(build_ext):
+ for directory in reversed(options.dirs):
+ add_dir_to_list(dir_list, directory)
+
+- if os.path.normpath(sys.prefix) != '/usr' \
+- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++ #if os.path.normpath(sys.prefix) != '/usr' \
++ #and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+ # building a framework with different architectures than
+ # the one that is currently installed (issue #7473)
+- add_dir_to_list(self.compiler.library_dirs,
++ add_dir_to_list(self.compiler.library_dirs,
+ sysconfig.get_config_var("LIBDIR"))
+- add_dir_to_list(self.compiler.include_dirs,
++ add_dir_to_list(self.compiler.include_dirs,
+ sysconfig.get_config_var("INCLUDEDIR"))
+
+ try:
+@@ -761,8 +761,7 @@ class PyBuildExt(build_ext):
+ pass # Issue 7384: Already linked against curses or tinfo.
+ elif curses_library:
+ readline_libs.append(curses_library)
+- elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ elif self.compiler.find_library_file(lib_dirs,
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch
new file mode 100644
index 000000000..202aaf106
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch
@@ -0,0 +1,86 @@
+On older versions of Python, sysconfig read the data from both the Makefile and
+the Python.h file generated at build time, created dictionaries with their variables
+and used those when using get_config_var(), now it uses _sysconfigdata.build_time_vars[]
+which contains information from the HOST, erroneous in our case, this patch reverts this
+behavior and uses Python.h and Makefile to get information.
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.9/Lib/distutils/sysconfig.py
+@@ -401,12 +401,66 @@ _config_vars = None
+
+ def _init_posix():
+ """Initialize the module as appropriate for POSIX systems."""
+- # _sysconfigdata is generated at build time, see the sysconfig module
+- from _sysconfigdata import build_time_vars
+- global _config_vars
+- _config_vars = {}
+- _config_vars.update(build_time_vars)
++ g = {}
++ # load the installed Makefile:
++ try:
++ filename = get_makefile_filename()
++ parse_makefile(filename, g)
++ except IOError, msg:
++ my_msg = "invalid Python installation: unable to open %s" % filename
++ if hasattr(msg, "strerror"):
++ my_msg = my_msg + " (%s)" % msg.strerror
++
++ raise DistutilsPlatformError(my_msg)
++
++ # load the installed pyconfig.h:
++ try:
++ filename = get_config_h_filename()
++ parse_config_h(file(filename), g)
++ except IOError, msg:
++ my_msg = "invalid Python installation: unable to open %s" % filename
++ if hasattr(msg, "strerror"):
++ my_msg = my_msg + " (%s)" % msg.strerror
++
++ raise DistutilsPlatformError(my_msg)
++
++ # On AIX, there are wrong paths to the linker scripts in the Makefile
++ # -- these paths are relative to the Python source, but when installed
++ # the scripts are in another directory.
++ if python_build:
++ g['LDSHARED'] = g['BLDSHARED']
+
++ elif get_python_version() < '2.1':
++ # The following two branches are for 1.5.2 compatibility.
++ if sys.platform == 'aix4': # what about AIX 3.x ?
++ # Linker script is in the config directory, not in Modules as the
++ # Makefile says.
++ python_lib = get_python_lib(standard_lib=1)
++ ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix')
++ python_exp = os.path.join(python_lib, 'config', 'python.exp')
++
++ g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp)
++
++ elif sys.platform == 'beos':
++ # Linker script is in the config directory. In the Makefile it is
++ # relative to the srcdir, which after installation no longer makes
++ # sense.
++ python_lib = get_python_lib(standard_lib=1)
++ linkerscript_path = string.split(g['LDSHARED'])[0]
++ linkerscript_name = os.path.basename(linkerscript_path)
++ linkerscript = os.path.join(python_lib, 'config',
++ linkerscript_name)
++
++ # XXX this isn't the right place to do this: adding the Python
++ # library to the link, if needed, should be in the "build_ext"
++ # command. (It's also needed for non-MS compilers on Windows, and
++ # it's taken care of for them by the 'build_ext.get_libraries()'
++ # method.)
++ g['LDSHARED'] = ("%s -L%s/lib -lpython%s" %
++ (linkerscript, PREFIX, get_python_version()))
++
++ global _config_vars
++ _config_vars = g
+
+ def _init_nt():
+ """Initialize the module as appropriate for NT"""
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/unixccompiler.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/unixccompiler.patch
new file mode 100644
index 000000000..450282912
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native/unixccompiler.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information.
+This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name.
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: Python-2.7.2/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-2.7.2.orig/Lib/distutils/unixccompiler.py 2011-11-24 13:51:10.539998722 -0800
++++ Python-2.7.2/Lib/distutils/unixccompiler.py 2011-11-24 15:54:36.872137766 -0800
+@@ -282,7 +282,7 @@
+ # this time, there's no way to determine this information from
+ # the configuration data stored in the Python installation, so
+ # we use this hack.
+- compiler = os.path.basename(sysconfig.get_config_var("CC"))
++ compiler = sysconfig.get_config_var("CC")
+ if sys.platform[:6] == "darwin":
+ # MacOSX's linker doesn't understand the -R flag at all
+ return "-L" + dir
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.11.bb
new file mode 100644
index 000000000..4c204a4f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-native_2.7.11.bb
@@ -0,0 +1,63 @@
+require python.inc
+
+EXTRANATIVEPATH += "bzip2-native"
+DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-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://12-distutils-prefix-is-inside-staging-area.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 \
+ file://avoid_parallel_make_races_on_pgen.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}"
+
+EXTRA_OEMAKE = '\
+ BUILD_SYS="" \
+ HOST_SYS="" \
+ 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-nose_1.3.7.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-nose_1.3.7.bb
new file mode 100644
index 000000000..ec6158fab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-nose_1.3.7.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Extends Python unittest to make testing easier"
+DESCRIPTION = "nose extends the test loading and running features of unittest, \
+making it easier to write, find and run tests."
+SECTION = "devel/python"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://lgpl.txt;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+SRC_URI = "http://pypi.python.org/packages/source/n/nose/nose-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "4d3ad0ff07b61373d2cefc89c5d0b20b"
+SRC_URI[sha256sum] = "f1bffef9cbc82628f6e7d7b40d7e255aefaa1adb6a1b1d26c69a8b79e6208a98"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/nose/"
+UPSTREAM_CHECK_REGEX = "/nose/(?P<pver>(\d+[\.\-_]*)+)"
+
+S = "${WORKDIR}/nose-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} = "\
+ python-unittest \
+ "
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch
new file mode 100644
index 000000000..5b134edf0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch
@@ -0,0 +1,78 @@
+From cc2ce6d8b6a3e6e2c8874896c10897034a80cd4f Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 10 Dec 2015 13:20:30 +0200
+Subject: [PATCH] Don't search /usr and so on for libraries by default to avoid
+ host contamination.
+
+Upstream-Status: Inappropriate (As the code stands, this is a hack)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ numpy/distutils/system_info.py | 50 +++++-------------------------------------
+ 1 file changed, 6 insertions(+), 44 deletions(-)
+
+diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
+index 9dd48e2..80e197a 100644
+--- a/numpy/distutils/system_info.py
++++ b/numpy/distutils/system_info.py
+@@ -204,51 +204,13 @@ if sys.platform == 'win32':
+ default_x11_lib_dirs = []
+ default_x11_include_dirs = []
+ else:
+- default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib',
+- '/opt/local/lib', '/sw/lib'], platform_bits)
+ default_runtime_dirs = []
+- default_include_dirs = ['/usr/local/include',
+- '/opt/include', '/usr/include',
+- # path of umfpack under macports
+- '/opt/local/include/ufsparse',
+- '/opt/local/include', '/sw/include',
+- '/usr/include/suitesparse']
+- default_src_dirs = ['.', '/usr/local/src', '/opt/src', '/sw/src']
+-
+- default_x11_lib_dirs = libpaths(['/usr/X11R6/lib', '/usr/X11/lib',
+- '/usr/lib'], platform_bits)
+- default_x11_include_dirs = ['/usr/X11R6/include', '/usr/X11/include',
+- '/usr/include']
+-
+- if os.path.exists('/usr/lib/X11'):
+- globbed_x11_dir = glob('/usr/lib/*/libX11.so')
+- if globbed_x11_dir:
+- x11_so_dir = os.path.split(globbed_x11_dir[0])[0]
+- default_x11_lib_dirs.extend([x11_so_dir, '/usr/lib/X11'])
+- default_x11_include_dirs.extend(['/usr/lib/X11/include',
+- '/usr/include/X11'])
+-
+- import subprocess as sp
+- tmp = None
+- try:
+- # Explicitly open/close file to avoid ResourceWarning when
+- # tests are run in debug mode Python 3.
+- tmp = open(os.devnull, 'w')
+- p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE,
+- stderr=tmp)
+- except (OSError, DistutilsError):
+- # OSError if gcc is not installed, or SandboxViolation (DistutilsError
+- # subclass) if an old setuptools bug is triggered (see gh-3160).
+- pass
+- else:
+- triplet = str(p.communicate()[0].decode().strip())
+- if p.returncode == 0:
+- # gcc supports the "-print-multiarch" option
+- default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
+- default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
+- finally:
+- if tmp is not None:
+- tmp.close()
++ default_lib_dirs = libpaths(['/deadir/lib'], platform_bits)
++ default_include_dirs = ['/deaddir/include']
++ default_src_dirs = ['.', '/deaddir/src']
++
++ default_x11_lib_dirs = libpaths(['/deaddir/lib'], platform_bits)
++ default_x11_include_dirs = ['/deaddir/include']
+
+ if os.path.join(sys.prefix, 'lib') not in default_lib_dirs:
+ default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib'))
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h
new file mode 100644
index 000000000..191e5a19e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h
@@ -0,0 +1,31 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/config.h
new file mode 100644
index 000000000..c30b868f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/aarch64/config.h
@@ -0,0 +1,139 @@
+#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/python-numpy/add-glibc-check.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/add-glibc-check.patch
new file mode 100644
index 000000000..29768f34d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/add-glibc-check.patch
@@ -0,0 +1,36 @@
+Dont punish musl for glibc's trignometeric functions problems
+additionally ensure that glibc specific macros are not used
+unconditionally
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: numpy-1.10.4/numpy/core/src/private/npy_config.h
+===================================================================
+--- numpy-1.10.4.orig/numpy/core/src/private/npy_config.h
++++ numpy-1.10.4/numpy/core/src/private/npy_config.h
+@@ -75,10 +75,12 @@
+
+ #if defined(HAVE_FEATURES_H)
+ #include <features.h>
++#ifdef __GLIBC__
+ #define TRIG_OK __GLIBC_PREREQ(2, 16)
+ #else
+ #define TRIG_OK 0
+ #endif
++#endif
+
+ #if !TRIG_OK
+ #undef HAVE_CASIN
+Index: numpy-1.10.4/numpy/core/src/npymath/ieee754.c.src
+===================================================================
+--- numpy-1.10.4.orig/numpy/core/src/npymath/ieee754.c.src
++++ numpy-1.10.4/numpy/core/src/npymath/ieee754.c.src
+@@ -612,7 +612,7 @@ void npy_set_floatstatus_invalid(void)
+ }
+
+
+-#elif defined(__GLIBC__) || defined(__APPLE__) || \
++#elif defined(__linux__) || defined(__APPLE__) || \
+ defined(__CYGWIN__) || defined(__MINGW32__) || \
+ (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
+ # include <fenv.h>
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/config.h
new file mode 100644
index 000000000..17ef186d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/config.h
@@ -0,0 +1,21 @@
+/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */
+/* #define SIZEOF_SHORT 2 */
+/* #define SIZEOF_INT 4 */
+/* #define SIZEOF_LONG 4 */
+/* #define SIZEOF_FLOAT 4 */
+/* #define SIZEOF_DOUBLE 8 */
+#define SIZEOF_LONG_DOUBLE 12
+#define SIZEOF_PY_INTPTR_T 4
+/* #define SIZEOF_LONG_LONG 8 */
+#define SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+#define MATHLIB m
+#define HAVE_FLOAT_FUNCS
+#define HAVE_LOG1P
+#define HAVE_EXPM1
+#define HAVE_INVERSE_HYPERBOLIC
+#define HAVE_INVERSE_HYPERBOLIC_FLOAT
+#define HAVE_ISNAN
+#define HAVE_ISINF
+#define HAVE_RINT
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h
new file mode 100644
index 000000000..c4bf6547f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h
@@ -0,0 +1,17 @@
+/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */
+/*
+ * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT
+ * */
+#define NPY_SIZEOF_SHORT 2
+#define NPY_SIZEOF_INT 4
+#define NPY_SIZEOF_LONG 4
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_LONGDOUBLE 12
+#define NPY_SIZEOF_PY_INTPTR_T 4
+#define NPY_NO_SMP 0
+
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/config.h
new file mode 100644
index 000000000..17ef186d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/config.h
@@ -0,0 +1,21 @@
+/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */
+/* #define SIZEOF_SHORT 2 */
+/* #define SIZEOF_INT 4 */
+/* #define SIZEOF_LONG 4 */
+/* #define SIZEOF_FLOAT 4 */
+/* #define SIZEOF_DOUBLE 8 */
+#define SIZEOF_LONG_DOUBLE 12
+#define SIZEOF_PY_INTPTR_T 4
+/* #define SIZEOF_LONG_LONG 8 */
+#define SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+#define MATHLIB m
+#define HAVE_FLOAT_FUNCS
+#define HAVE_LOG1P
+#define HAVE_EXPM1
+#define HAVE_INVERSE_HYPERBOLIC
+#define HAVE_INVERSE_HYPERBOLIC_FLOAT
+#define HAVE_ISNAN
+#define HAVE_ISINF
+#define HAVE_RINT
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h
new file mode 100644
index 000000000..c4bf6547f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h
@@ -0,0 +1,17 @@
+/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */
+/*
+ * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT
+ * */
+#define NPY_SIZEOF_SHORT 2
+#define NPY_SIZEOF_INT 4
+#define NPY_SIZEOF_LONG 4
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_LONGDOUBLE 12
+#define NPY_SIZEOF_PY_INTPTR_T 4
+#define NPY_NO_SMP 0
+
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h
new file mode 100644
index 000000000..05d2b8b94
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h
@@ -0,0 +1,31 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 8
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 16
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 4
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/config.h
new file mode 100644
index 000000000..2f6135adc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 4
+#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_DOUBLE_BE 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/python-numpy/mips64/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h
new file mode 100644
index 000000000..8e2b5d094
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h
@@ -0,0 +1,31 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/config.h
new file mode 100644
index 000000000..c30b868f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64/config.h
@@ -0,0 +1,139 @@
+#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/python-numpy/mips64n32/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h
new file mode 100644
index 000000000..8e2b5d094
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h
@@ -0,0 +1,31 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/config.h
new file mode 100644
index 000000000..c30b868f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mips64n32/config.h
@@ -0,0 +1,139 @@
+#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/python-numpy/mipsel/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/config.h
new file mode 100644
index 000000000..17ef186d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/config.h
@@ -0,0 +1,21 @@
+/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */
+/* #define SIZEOF_SHORT 2 */
+/* #define SIZEOF_INT 4 */
+/* #define SIZEOF_LONG 4 */
+/* #define SIZEOF_FLOAT 4 */
+/* #define SIZEOF_DOUBLE 8 */
+#define SIZEOF_LONG_DOUBLE 12
+#define SIZEOF_PY_INTPTR_T 4
+/* #define SIZEOF_LONG_LONG 8 */
+#define SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+#define MATHLIB m
+#define HAVE_FLOAT_FUNCS
+#define HAVE_LOG1P
+#define HAVE_EXPM1
+#define HAVE_INVERSE_HYPERBOLIC
+#define HAVE_INVERSE_HYPERBOLIC_FLOAT
+#define HAVE_ISNAN
+#define HAVE_ISINF
+#define HAVE_RINT
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h
new file mode 100644
index 000000000..c4bf6547f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h
@@ -0,0 +1,17 @@
+/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */
+/*
+ * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT
+ * */
+#define NPY_SIZEOF_SHORT 2
+#define NPY_SIZEOF_INT 4
+#define NPY_SIZEOF_LONG 4
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_LONGDOUBLE 12
+#define NPY_SIZEOF_PY_INTPTR_T 4
+#define NPY_NO_SMP 0
+
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h
new file mode 100644
index 000000000..0f45d5bd4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h
@@ -0,0 +1,31 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 4
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/config.h
new file mode 100644
index 000000000..f65d39d5d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 4
+#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_DOUBLE_DOUBLE_BE 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/python-numpy/powerpc64/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h
new file mode 100644
index 000000000..8e2b5d094
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h
@@ -0,0 +1,31 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/config.h
new file mode 100644
index 000000000..c30b868f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/powerpc64/config.h
@@ -0,0 +1,139 @@
+#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/python-numpy/remove-build-path-in-comments.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/remove-build-path-in-comments.patch
new file mode 100644
index 000000000..eb8a71a2e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/remove-build-path-in-comments.patch
@@ -0,0 +1,30 @@
+From c560abff71f98a39a7401f08c2c13dad9ae7f15f Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 25 Feb 2016 01:23:32 -0500
+Subject: [PATCH] remove build path in comments
+
+It has build path in comments, so remove it.
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ numpy/distutils/misc_util.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py
+index 345e60f..dafb068 100644
+--- a/numpy/distutils/misc_util.py
++++ b/numpy/distutils/misc_util.py
+@@ -2254,7 +2254,7 @@ def generate_config_py(target):
+ from distutils.dir_util import mkpath
+ mkpath(os.path.dirname(target))
+ f = open(target, 'w')
+- f.write('# This file is generated by %s\n' % (os.path.abspath(sys.argv[0])))
++ f.write('# This file is generated by %s\n' % (os.path.abspath(sys.argv[0]).replace(os.path.abspath('../'),'')))
+ f.write('# It contains system_info results at the time of building this package.\n')
+ f.write('__all__ = ["get_info","show"]\n\n')
+ for k, i in system_info.saved_results.items():
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h
new file mode 100644
index 000000000..b33036164
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h
@@ -0,0 +1,32 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_OFF_T 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/config.h
new file mode 100644
index 000000000..0ce63b7d2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86-64/config.h
@@ -0,0 +1,139 @@
+#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_INTEL_EXTENDED_16_BYTES_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/python-numpy/x86/config.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86/config.h
new file mode 100644
index 000000000..08e41e3d9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86/config.h
@@ -0,0 +1,108 @@
+#define SIZEOF_PY_INTPTR_T 4
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN
+#define HAVE_COS
+#define HAVE_TAN
+#define HAVE_SINH
+#define HAVE_COSH
+#define HAVE_TANH
+#define HAVE_FABS
+#define HAVE_FLOOR
+#define HAVE_CEIL
+#define HAVE_SQRT
+#define HAVE_LOG10
+#define HAVE_LOG
+#define HAVE_EXP
+#define HAVE_ASIN
+#define HAVE_ACOS
+#define HAVE_ATAN
+#define HAVE_FMOD
+#define HAVE_MODF
+#define HAVE_FREXP
+#define HAVE_LDEXP
+#define HAVE_RINT
+#define HAVE_TRUNC
+#define HAVE_EXP2
+#define HAVE_LOG2
+#define HAVE_ATAN2
+#define HAVE_POW
+#define HAVE_NEXTAFTER
+#define HAVE_SINF
+#define HAVE_COSF
+#define HAVE_TANF
+#define HAVE_SINHF
+#define HAVE_COSHF
+#define HAVE_TANHF
+#define HAVE_FABSF
+#define HAVE_FLOORF
+#define HAVE_CEILF
+#define HAVE_RINTF
+#define HAVE_TRUNCF
+#define HAVE_SQRTF
+#define HAVE_LOG10F
+#define HAVE_LOGF
+#define HAVE_LOG1PF
+#define HAVE_EXPF
+#define HAVE_EXPM1F
+#define HAVE_ASINF
+#define HAVE_ACOSF
+#define HAVE_ATANF
+#define HAVE_ASINHF
+#define HAVE_ACOSHF
+#define HAVE_ATANHF
+#define HAVE_HYPOTF
+#define HAVE_ATAN2F
+#define HAVE_POWF
+#define HAVE_FMODF
+#define HAVE_MODFF
+#define HAVE_FREXPF
+#define HAVE_LDEXPF
+#define HAVE_EXP2F
+#define HAVE_LOG2F
+#define HAVE_COPYSIGNF
+#define HAVE_NEXTAFTERF
+#define HAVE_SINL
+#define HAVE_COSL
+#define HAVE_TANL
+#define HAVE_SINHL
+#define HAVE_COSHL
+#define HAVE_TANHL
+#define HAVE_FABSL
+#define HAVE_FLOORL
+#define HAVE_CEILL
+#define HAVE_RINTL
+#define HAVE_TRUNCL
+#define HAVE_SQRTL
+#define HAVE_LOG10L
+#define HAVE_LOGL
+#define HAVE_LOG1PL
+#define HAVE_EXPL
+#define HAVE_EXPM1L
+#define HAVE_ASINL
+#define HAVE_ACOSL
+#define HAVE_ATANL
+#define HAVE_ASINHL
+#define HAVE_ACOSHL
+#define HAVE_ATANHL
+#define HAVE_HYPOTL
+#define HAVE_ATAN2L
+#define HAVE_POWL
+#define HAVE_FMODL
+#define HAVE_MODFL
+#define HAVE_FREXPL
+#define HAVE_LDEXPL
+#define HAVE_EXP2L
+#define HAVE_LOG2L
+#define HAVE_COPYSIGNL
+#define HAVE_NEXTAFTERL
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H
+#define HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_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/python-numpy/x86/numpyconfig.h b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86/numpyconfig.h
new file mode 100644
index 000000000..ff7938cd9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy/x86/numpyconfig.h
@@ -0,0 +1,24 @@
+#ifndef _NPY_NUMPYCONFIG_H_
+#define _NPY_NUMPYCONFIG_H_
+
+#include "_numpyconfig.h"
+
+/*
+ * On Mac OS X, because there is only one configuration stage for all the archs
+ * in universal builds, any macro which depends on the arch needs to be
+ * harcoded
+ */
+#ifdef __APPLE__
+ #undef NPY_SIZEOF_LONG
+ #undef NPY_SIZEOF_PY_INTPTR_T
+
+ #ifdef __LP64__
+ #define NPY_SIZEOF_LONG 8
+ #define NPY_SIZEOF_PY_INTPTR_T 8
+ #else
+ #define NPY_SIZEOF_LONG 4
+ #define NPY_SIZEOF_PY_INTPTR_T 4
+ #endif
+#endif
+
+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy_1.10.4.bb
new file mode 100644
index 000000000..8a562dcb9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-numpy_1.10.4.bb
@@ -0,0 +1,102 @@
+SUMMARY = "A sophisticated Numeric Processing Package for Python"
+SECTION = "devel/python"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=9f4e88b5748e8313caaf33d081ce65a3"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/numpy/numpy-${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://add-glibc-check.patch \
+ ${CONFIGFILESURI} "
+
+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 distutils
+
+# Make the build fail and replace *config.h with proper one
+# This is a ugly, ugly hack - Koen
+do_compile_prepend_class-target() {
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ ${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] = "90bb9034652cefbada19cf7d141a6a61"
+SRC_URI[sha256sum] = "f7f91842056a7cf680b0eaf8cefc5e46c69e2521e651128d2e6aaaccec8652ae"
+
+# 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/python-pexpect_4.0.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pexpect_4.0.1.bb
new file mode 100644
index 000000000..7f142a385
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pexpect_4.0.1.bb
@@ -0,0 +1,25 @@
+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=66c2378a96b307d56bfb3a9e58edafa8"
+
+SRC_URI = "https://pypi.python.org/packages/source/p/pexpect/pexpect-${PV}.tar.gz"
+SRC_URI[md5sum] = "056df81e6ca7081f1015b4b147b977b7"
+SRC_URI[sha256sum] = "232795ebcaaf2e120396dbbaa3a129eda51757eeaae1911558f4ef8ee414fc6c"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/pexpect"
+
+S = "${WORKDIR}/pexpect-${PV}"
+
+inherit distutils
+
+RDEPENDS_${PN} = "\
+ python-core \
+ python-io \
+ python-terminal \
+ python-resource \
+ python-fcntl \
+"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycairo_1.10.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
new file mode 100644
index 000000000..70fe25c1a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Python bindings for the Cairo canvas library"
+HOMEPAGE = "http://cairographics.org/pycairo"
+BUGTRACKER = "http://bugs.freedesktop.org"
+SECTION = "python-devel"
+LICENSE = "LGPLv2.1 & MPL-1.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f2e071ab72978431b294a0d696327421 \
+ file://COPYING-LGPL-2.1;md5=fad9b3332be894bab9bc501572864b29 \
+ file://COPYING-MPL-1.1;md5=bfe1f75d606912a4111c90743d6c7325"
+
+# cairo >= 1.8.8
+DEPENDS = "cairo"
+PR = "r2"
+
+SRC_URI = "http://cairographics.org/releases/py2cairo-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "20337132c4ab06c1146ad384d55372c5"
+SRC_URI[sha256sum] = "d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431"
+
+S = "${WORKDIR}/py2cairo-${PV}"
+
+inherit distutils pkgconfig
+
+BBCLASSEXTEND = "native"
+
+do_configure() {
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} ./waf configure --prefix=${D}${prefix} --libdir=${D}${libdir}
+}
+
+do_compile() {
+ ./waf build ${PARALLEL_MAKE}
+}
+
+do_install() {
+ ./waf install
+ sed \
+ -e 's:@prefix@:${prefix}:' \
+ -e 's:@VERSION@:${PV}:' \
+ -e 's:@includedir@:${includedir}:' \
+ pycairo.pc.in > pycairo.pc
+ install -m 0644 pycairo.pc ${D}${libdir}/pkgconfig/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl/no-static-link.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl/no-static-link.patch
new file mode 100644
index 000000000..212779ca3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl/no-static-link.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur pycurl-7.19.5.2-orig/setup.py pycurl-7.19.5.2/setup.py
+--- pycurl-7.19.5.2-orig/setup.py 2015-11-02 15:42:24.000000000 +0200
++++ pycurl-7.19.5.2/setup.py 2015-11-02 17:59:36.121527273 +0200
+@@ -154,7 +154,7 @@
+ optbuf = ''
+ sslhintbuf = ''
+ errtext = ''
+- for option in ["--libs", "--static-libs"]:
++ for option in ["--libs"]:
+ p = subprocess.Popen((CURL_CONFIG, option),
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
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
new file mode 100644
index 000000000..7b41f6d33
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pycurl_7.21.5.bb
@@ -0,0 +1,33 @@
+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}"
+
+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-pygobject/0001-configure.ac-add-sysroot-path-to-GI_DATADIR-don-t-se.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject/0001-configure.ac-add-sysroot-path-to-GI_DATADIR-don-t-se.patch
new file mode 100644
index 000000000..a391f7e74
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject/0001-configure.ac-add-sysroot-path-to-GI_DATADIR-don-t-se.patch
@@ -0,0 +1,41 @@
+From 5e5350d730f85957a42c6d846d347d080e7dd996 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 23 Oct 2015 12:40:34 +0300
+Subject: [PATCH] configure.ac: add sysroot path to GI_DATADIR; don't set
+ introspection scanner and compiler paths
+
+Upstream-Status: Pending [review on oe-core maillist]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2c0cfbd..cfcb3bf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -194,7 +194,7 @@ PKG_CHECK_MODULES(GI,
+ gobject-introspection-1.0 >= introspection_required_version
+ )
+
+-GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0)
++GI_DATADIR=$PKG_CONFIG_SYSROOT_DIR$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0)
+ AC_SUBST(GI_DATADIR)
+
+ if test "$enable_cairo" != no; then
+@@ -219,12 +219,6 @@ AC_ARG_WITH(common,
+ with_common=yes)
+ AM_CONDITIONAL(WITH_COMMON, test "$with_common" = "yes")
+
+-INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+-INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+-
+-AC_SUBST(INTROSPECTION_SCANNER)
+-AC_SUBST(INTROSPECTION_COMPILER)
+-
+ # compiler warnings, errors, required cflags, and code coverage support
+ GNOME_COMPILE_WARNINGS([maximum])
+ AC_MSG_CHECKING(for Gnome code coverage support)
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject_3.18.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject_3.18.2.bb
new file mode 100644
index 000000000..a9871fe26
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pygobject_3.18.2.bb
@@ -0,0 +1,25 @@
+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
+
+DEPENDS += "python glib-2.0 gnome-common"
+
+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] = "0a956f3e785e23b0f136832f2e57a862"
+SRC_URI[sha256sum] = "2a3cad1517916b74e131e6002c3824361aee0671ffb0d55ded119477fc1c2c5f"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF = "--disable-cairo --with-python=python2.7"
+
+RDEPENDS_${PN} += "python-setuptools python-importlib"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb
new file mode 100644
index 000000000..e8ef1aa12
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb
@@ -0,0 +1,5 @@
+require python-pyrex_${PV}.bb
+inherit native pythonnative
+DEPENDS = "python-native"
+RDEPENDS_${PN} = ""
+PR = "r3"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch
new file mode 100644
index 000000000..c58c3280e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Index: Pyrex-0.9.8.4/Pyrex/Distutils/extension.py
+===================================================================
+--- Pyrex-0.9.8.4.orig/Pyrex/Distutils/extension.py
++++ Pyrex-0.9.8.4/Pyrex/Distutils/extension.py
+@@ -15,7 +15,7 @@ except ImportError:
+ warnings = None
+
+ class Extension(_Extension.Extension):
+- _Extension.Extension.__doc__ + \
++ _Extension.Extension.__doc__ or "" + \
+ """pyrex_include_dirs : [string]
+ list of directories to search for Pyrex header files (.pxd) (in
+ Unix form for portability)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex_0.9.9.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex_0.9.9.bb
new file mode 100644
index 000000000..c4dd2e69b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-pyrex_0.9.9.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Language for writing Python extension modules"
+DESCRIPTION = "Pyrex is a language specially designed for writing Python extension modules. \
+It's designed to bridge the gap between the nice, high-level, easy-to-use world of Python \
+and the messy, low-level world of C."
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=771d472f53f933033f57eeee7808e5bd"
+SRCNAME = "Pyrex"
+PR = "r4"
+
+SRC_URI = "\
+ http://www.cosc.canterbury.ac.nz/greg.ewing/python/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
+ file://pyrex-fix-optimized-mode.patch \
+"
+
+SRC_URI[md5sum] = "515dee67d15d4393841e2d60e8341947"
+SRC_URI[sha256sum] = "5f87df06831d0b3412eb4bc9d3fc2ee7bfae1b913d7da8c23ab2bf5699fb6b50"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils
+
+FILES_${PN} += "${datadir}${base_libdir}/${PYTHON_DIR}/site-packages/Pyrex/Compiler/Lexicon.pickle"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons-native_2.4.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons-native_2.4.1.bb
new file mode 100644
index 000000000..dae89ab5d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons-native_2.4.1.bb
@@ -0,0 +1,8 @@
+require python-scons_${PV}.bb
+inherit native pythonnative
+DEPENDS = "python-native"
+RDEPENDS_${PN} = ""
+
+do_install_append() {
+ create_wrapper ${D}${bindir}/scons SCONS_LIB_DIR='${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}'
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.4.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.4.1.bb
new file mode 100644
index 000000000..096cf5c96
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-scons_2.4.1.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Software Construction tool (make/autotools replacement)"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=23bc1530c55e9f0d1b709056bcea237d"
+SRCNAME = "scons"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/scons/scons-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "9a0ddf33d9839f04380e0fae87cc4b40"
+SRC_URI[sha256sum] = "8fc4f42928c69bcbb33e1be94b646f2c700b659693fabc778c192d4d22f753a7"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/scons/files/scons/"
+UPSTREAM_CHECK_REGEX = "/scons/(?P<pver>(\d+[\.\-_]*)+)/"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils
+
+RDEPENDS_${PN} = "\
+ python-fcntl \
+ python-io \
+ "
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
new file mode 100644
index 000000000..0917e88ab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools.inc
@@ -0,0 +1,21 @@
+SUMMARY = "Download, build, install, upgrade, and uninstall Python packages"
+HOMEPAGE = "https://pypi.python.org/pypi/setuptools"
+SECTION = "devel/python"
+LICENSE = "PSF | ZPL-2.0"
+
+LIC_FILES_CHKSUM = "file://setup.py;beginline=78;endline=78;md5=8a314270dd7a8dbca741775415f1716e"
+
+SRCNAME = "setuptools"
+
+SRC_URI = "http://pypi.python.org/packages/source/s/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "c5a7d90c1e0acf8c4ec5c2bf31bc25b5"
+SRC_URI[sha256sum] = "214bf29933f47cf25e6faa569f710731728a07a19cae91ea64f826051f68a8cf"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/setuptools"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+do_install_prepend() {
+ install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools_19.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools_19.4.bb
new file mode 100644
index 000000000..c17203923
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-setuptools_19.4.bb
@@ -0,0 +1,38 @@
+require python-setuptools.inc
+
+PROVIDES = "python-distribute"
+
+DEPENDS += "python"
+DEPENDS_class-native += "python-native"
+
+inherit distutils
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
+
+RDEPENDS_${PN} = "\
+ python-stringold \
+ python-email \
+ python-shell \
+ python-distutils \
+ python-compression \
+ python-pkgutil \
+ python-plistlib \
+ python-numbers \
+ python-html \
+ python-netserver \
+ python-ctypes \
+ python-subprocess \
+ python-unittest \
+ python-compile \
+"
+
+RDEPENDS_${PN}_class-native = "\
+ python-distutils \
+ python-compression \
+"
+
+RREPLACES_${PN} = "python-distribute"
+RPROVIDES_${PN} = "python-distribute"
+RCONFLICTS_${PN} = "python-distribute"
+
+BBCLASSEXTEND = "native nativesdk"
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
new file mode 100644
index 000000000..fe98d070d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch
@@ -0,0 +1,35 @@
+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
new file mode 100644
index 000000000..9055555cd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch
@@ -0,0 +1,54 @@
+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
new file mode 100644
index 000000000..6e672b332
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch
@@ -0,0 +1,158 @@
+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
new file mode 100644
index 000000000..ec98e03c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch
@@ -0,0 +1,177 @@
+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 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:
++ if probs 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
new file mode 100644
index 000000000..225b02f96
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch
@@ -0,0 +1,43 @@
+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-channelsdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch
new file mode 100644
index 000000000..e621b3387
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch
@@ -0,0 +1,24 @@
+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-improve-error-reporting.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
new file mode 100644
index 000000000..b82265b3f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
@@ -0,0 +1,91 @@
+Improve error reporting in smart
+
+Add code to check proper command line arguments for various
+smart commands. Exit with error if erroneous/additional arguments
+are given in the command line.
+
+Upstream-Status: Pending
+
+Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
+
+diff --git a/smart/util/optparse.py b/smart/util/optparse.py
+index 6fff1bc..f445a3b 100644
+--- a/smart/util/optparse.py
++++ b/smart/util/optparse.py
+@@ -70,6 +70,8 @@ import sys, os
+ import types
+ import textwrap
+ from gettext import gettext as _
++from smart import Error
++import re
+
+ def _repr(self):
+ return "<%s at 0x%x: %s>" % (self.__class__.__name__, id(self), self)
+@@ -710,6 +712,12 @@ class Option:
+ self.action, self.dest, opt, value, values, parser)
+
+ def take_action(self, action, dest, opt, value, values, parser):
++ # Keep all the options in the command line in the '_given_opts' array
++ # This will be used later to validate the command line
++ given_opts = getattr(parser.values, "_given_opts", [])
++ user_opt = re.sub(r"^\-*", "", opt).replace("-", "_")
++ given_opts.append(user_opt)
++ setattr(parser.values, "_given_opts", given_opts)
+ if action == "store":
+ setattr(values, dest, value)
+ elif action == "store_const":
+@@ -821,6 +829,54 @@ class Values:
+ setattr(self, attr, value)
+ return getattr(self, attr)
+
++ # Check if the given option has the specified number of arguments
++ # Raise an error if the option has an invalid number of arguments
++ # A negative number for 'nargs' means "at least |nargs| arguments are needed"
++ def check_args_of_option(self, opt, nargs, err=None):
++ given_opts = getattr(self, "_given_opts", [])
++ if not opt in given_opts:
++ return
++ values = getattr(self, opt, [])
++ if type(values) != type([]):
++ return
++ if nargs < 0:
++ nargs = -nargs
++ if len(values) >= nargs:
++ return
++ if not err:
++ if nargs == 1:
++ err = _("Option '%s' requires at least one argument") % opt
++ else:
++ err = _("Option '%s' requires at least %d arguments") % (opt, nargs)
++ raise Error, err
++ elif nargs == 0:
++ if len( values ) == 0:
++ return
++ raise Error, err
++ else:
++ if len(values) == nargs:
++ return
++ if not err:
++ if nargs == 1:
++ err = _("Option '%s' requires one argument") % opt
++ else:
++ err = _("Option '%s' requires %d arguments") % (opt, nargs)
++ raise Error, err
++
++ # Check that at least one of the options in 'actlist' was given as an argument
++ # to the command 'cmdname'
++ def ensure_action(self, cmdname, actlist):
++ given_opts = getattr(self, "_given_opts", [])
++ for action in actlist:
++ if action in given_opts:
++ return
++ raise Error, _("No action specified for command '%s'") % cmdname
++
++ # Check if there are any other arguments left after parsing the command line and
++ # raise an error if such arguments are found
++ def check_remaining_args(self):
++ if self.args:
++ raise Error, _("Invalid argument(s) '%s'" % str(self.args))
+
+ class OptionContainer:
+
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
new file mode 100644
index 000000000..d607fc475
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch
@@ -0,0 +1,381 @@
+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-set-noprogress-for-pycurl.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch
new file mode 100644
index 000000000..2885998ac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch
@@ -0,0 +1,20 @@
+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-nodig.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch
new file mode 100644
index 000000000..fefb29a66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch
@@ -0,0 +1,59 @@
+RPM5 has removed support for RPMVSF_NOSIGNATURES
+
+Patch smart to no longer use this flag
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
+--- a/smart/backends/rpm/base.py
++++ b/smart/backends/rpm/base.py
+@@ -63,11 +63,11 @@ 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")
++ #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")
+ 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 +89,11 @@ 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")
++ #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")
+ return ts
+ else:
+ return getTS.ts
+diff --git a/smart/plugins/yumchannelsync.py b/smart/plugins/yumchannelsync.py
+--- a/smart/plugins/yumchannelsync.py
++++ b/smart/plugins/yumchannelsync.py
+@@ -56,8 +56,8 @@ 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))
++ #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')
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
new file mode 100644
index 000000000..d9a908db2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smartpm_git.bb
@@ -0,0 +1,137 @@
+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://smartpm-rpm5-nodig.patch \
+ file://smart-recommends.patch \
+ file://smart-improve-error-reporting.patch \
+ file://smart-channelsdir.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 \
+ "
+
+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}${libdir}/python*/site-packages/smart/backends/slack
+ rm -rf ${D}${libdir}/python*/site-packages/smart/backends/arch
+ rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt
+
+ # Temporary, debian support in OE is missing the python module
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/aptchannelsync.py*
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/debdir.py*
+ rm -rf ${D}${libdir}/python*/site-packages/smart/backends/deb
+
+ # Disable automatic channel detection
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/detectsys.py*
+
+ # Disable landscape support
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/landscape.py*
+
+ # Disable urpmi channel support
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/urpmichannelsync.py*
+
+ # Disable yum channel support
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/yumchannelsync.py*
+
+ # Disable zypper channel support
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/zyppchannelsync.py*
+
+ if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then
+ rm -f ${D}${libdir}/python*/site-packages/smart/plugins/rpmdir.py*
+ rm -rf ${D}${libdir}/python*/site-packages/smart/backends/rpm
+ fi
+
+ if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then
+ rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt4
+ fi
+
+ if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then
+ rm -rf ${D}${libdir}/python*/site-packages/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 = "${libdir}/python*/site-packages/smart/backends/rpm"
+
+FILES_${PN}-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4"
+FILES_${PN}-interface-gtk = "${libdir}/python*/site-packages/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-smmap_0.9.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smmap_0.9.0.bb
new file mode 100644
index 000000000..5f9cf452e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-smmap_0.9.0.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Python implementation of a sliding window memory map manager"
+DESCRIPTION = "A pure Python implementation of a sliding memory map to \
+help unifying memory mapped access on 32 and 64 bit systems and to help \
+managing resources more efficiently."
+HOMEPAGE = "http://github.com/gitpython-developers/GitPython"
+SECTION = "devel/python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709"
+
+SRC_URI = "http://pypi.python.org/packages/source/s/smmap/smmap-${PV}.tar.gz"
+SRC_URI[md5sum] = "d7932d5ace206bf4ae15198cf36fb6ab"
+SRC_URI[sha256sum] = "0e2b62b497bd5f0afebc002eda4d90df9d209c30ef257e8673c90a6b5c119d62"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/smmap/"
+UPSTREAM_CHECK_REGEX = "/smmap/(?P<pver>(\d+[\.\-_]*)+)"
+
+S = "${WORKDIR}/smmap-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} += "python-codecs python-mmap python-lang"
+
+BBCLASSEXTEND = "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
new file mode 100644
index 000000000..f4818c6a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python.inc
@@ -0,0 +1,32 @@
+SUMMARY = "The Python Programming Language"
+HOMEPAGE = "http://www.python.org"
+LICENSE = "PSFv2"
+SECTION = "devel/python"
+# bump this on every change in contrib/python/generate-manifest-2.7.py
+INC_PR = "r1"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=dd98d01d471fac8d8dbdd975229dba03"
+
+SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "1dbcc848b4cd8399a8199d000f9f823c"
+SRC_URI[sha256sum] = "962b4c45af50124ea61f11a30deb4342fc0bc21126790fa1d7f6c79809413f46"
+
+# 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"
+
+PYTHON_MAJMIN = "2.7"
+
+inherit autotools
+
+EXTRA_OECONF = "\
+ --with-threads \
+ --with-pymalloc \
+ --without-cxx-main \
+ --with-signal-module \
+ --enable-shared \
+ --enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)} \
+ ac_cv_header_bluetooth_bluetooth_h=no ac_cv_header_bluetooth_h=no \
+ ${PYTHONLSBOPTS} \
+"
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
new file mode 100644
index 000000000..1257ca655
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
@@ -0,0 +1,97 @@
+We need to ensure our host tools get run during build, not the freshly
+built cross-tools (this will not work), so we introduce HOSTPYTHON and HOSTPGEN.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Rebased for python-2.7.9
+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
+@@ -234,6 +234,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
+ ##########################################################################
+ # Parser
+ PGEN= Parser/pgen$(EXE)
++HOSTPGEN= $(PGEN)$(EXE)
+
+ PSRCS= \
+ Parser/acceler.c \
+@@ -445,7 +446,7 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA
+ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+
+ platform: $(BUILDPYTHON) pybuilddir.txt
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
++ $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
+
+ # Create build directory and generate the sysconfig build-time data there.
+ # pybuilddir.txt contains the name of the build dir and is used for
+@@ -611,7 +612,7 @@ Modules/pwdmodule.o: $(srcdir)/Modules/p
+ $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
+ @$(MKDIR_P) Include
+ $(MAKE) $(PGEN)
+- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
++ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
+ $(MAKE) $(GRAMMAR_H)
+ touch $(GRAMMAR_C)
+@@ -1043,27 +1044,27 @@ libinstall: build_all $(srcdir)/Lib/$(PL
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+ PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -tt $(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 -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -tt $(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 -t $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -tt $(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
++ $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
++ $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):
+Index: Python-2.7.9/setup.py
+===================================================================
+--- Python-2.7.9.orig/setup.py
++++ Python-2.7.9/setup.py
+@@ -334,6 +334,7 @@ class PyBuildExt(build_ext):
+ self.failed.append(ext.name)
+ self.announce('*** WARNING: renaming "%s" since importing it'
+ ' failed: %s' % (ext.name, why), level=3)
++ return
+ assert not self.inplace
+ basename, tail = os.path.splitext(ext_filename)
+ newname = basename + "_failed" + tail
+@@ -558,6 +559,9 @@ class PyBuildExt(build_ext):
+
+ # XXX Omitted modules: gl, pure, dl, SGI-specific modules
+
++ lib_dirs = [ os.getenv("STAGING_LIBDIR"), os.getenv("STAGING_BASELIBDIR") ]
++ inc_dirs = [ os.getenv("STAGING_INCDIR") ]
++
+ #
+ # The following modules are all pretty straightforward, and compile
+ # on pretty much any POSIXish platform.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch
new file mode 100644
index 000000000..650ceb595
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+We need to supply STAGING_INCDIR here, otherwise the Tk headers
+will not be found.
+
+Signed-off-by: Michael 'Mickey' Lauer <mickey@vanille.de>
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Rebased for python-2.7.9
+
+diff --git a/setup.py b/setup.py
+index 8fe1fb8..67eda74 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1892,7 +1892,7 @@ class PyBuildExt(build_ext):
+ dotversion = dotversion[:-1] + '.' + dotversion[-1]
+ tcl_include_sub = []
+ tk_include_sub = []
+- for dir in inc_dirs:
++ for dir in [os.getenv("STAGING_INCDIR")]:
+ tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
+ tk_include_sub += [dir + os.sep + "tk" + dotversion]
+ tk_include_sub += tcl_include_sub
+@@ -1911,22 +1911,6 @@ class PyBuildExt(build_ext):
+ if dir not in include_dirs:
+ include_dirs.append(dir)
+
+- # Check for various platform-specific directories
+- if host_platform == 'sunos5':
+- include_dirs.append('/usr/openwin/include')
+- added_lib_dirs.append('/usr/openwin/lib')
+- elif os.path.exists('/usr/X11R6/include'):
+- include_dirs.append('/usr/X11R6/include')
+- added_lib_dirs.append('/usr/X11R6/lib64')
+- added_lib_dirs.append('/usr/X11R6/lib')
+- elif os.path.exists('/usr/X11R5/include'):
+- include_dirs.append('/usr/X11R5/include')
+- added_lib_dirs.append('/usr/X11R5/lib')
+- else:
+- # Assume default location for X11
+- include_dirs.append('/usr/X11/include')
+- added_lib_dirs.append('/usr/X11/lib')
+-
+ # If Cygwin, then verify that X is installed before proceeding
+ if host_platform == 'cygwin':
+ x11_inc = find_file('X11/Xlib.h', [], include_dirs)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch
new file mode 100644
index 000000000..5cc874246
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch
@@ -0,0 +1,27 @@
+Rebased for python 2.7.9
+
+Upstream-Status: Inappropriate [embedded specific]
+
+# CTypes need to know the actual host we are building on.
+# Signed-Off: Michael Dietrich <mdt@emdete.de>
+
+Index: Python-2.7.9/setup.py
+===================================================================
+--- Python-2.7.9.orig/setup.py
++++ Python-2.7.9/setup.py
+@@ -2028,12 +2028,12 @@ class PyBuildExt(build_ext):
+
+ # Pass empty CFLAGS because we'll just append the resulting
+ # CFLAGS to Python's; -g or -O2 is to be avoided.
+- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
+- % (ffi_builddir, ffi_srcdir, " ".join(config_args))
++ cmd = "(cd %s && autoconf -W cross) && (cd %s && env CFLAGS='' '%s/configure' %s)" \
++ % (ffi_srcdir, ffi_builddir, ffi_srcdir, " ".join(config_args))
+
+ res = os.system(cmd)
+ if res or not os.path.exists(ffi_configfile):
+- print "Failed to configure _ctypes module"
++ print "Failed to configure _ctypes module (res=%d) or missing conffile=%s" % ( res, ffi_configfile )
+ return False
+
+ fficonfig = {}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
new file mode 100644
index 000000000..e452cb6ac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+The poison directories patch has detected library path issue while
+compiling the python in cross environment, as seen bellow.
+
+warning: library search path "/usr/lib/termcap" is unsafe for cross-compilation
+
+This Patch fixes this issue in the python build environment.
+11 Oct 2010
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+2011/09/29
+Rebased for python 2.7.2
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+diff --git a/setup.py b/setup.py
+index 67eda74..59c537e 100644
+--- a/setup.py
++++ b/setup.py
+@@ -761,12 +761,10 @@ class PyBuildExt(build_ext):
+ pass # Issue 7384: Already linked against curses or tinfo.
+ elif curses_library:
+ readline_libs.append(curses_library)
+- elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ elif self.compiler.find_library_file(lib_dirs,
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ else:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
new file mode 100644
index 000000000..a97ff6b25
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
@@ -0,0 +1,28 @@
+configure.ac: add CROSSPYTHONPATH into PYTHONPATH for PYTHON_FOR_BUILD
+
+When building x86->x86 the system will try to execute .so and related items
+from the default PYTHONPATH. This will fail if the target CPU contains
+instructions that the host CPU does not have, add CROSSPYTHONPATH
+into PYTHONPATH so we can prepend the list to find correct libs.
+
+Upstream-Status: Inappropriate [OE-Core integration specific]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: Python-2.7.11/configure.ac
+===================================================================
+--- Python-2.7.11.orig/configure.ac
++++ Python-2.7.11/configure.ac
+@@ -33,7 +33,7 @@ if test "$cross_compiling" = yes; then
+ AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
+ fi
+ AC_MSG_RESULT($interp)
+- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
++ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH):$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) '$interp
+ fi
+ elif test "$cross_compiling" = maybe; then
+ AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/add-md5module-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/add-md5module-support.patch
new file mode 100644
index 000000000..33fea7755
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/add-md5module-support.patch
@@ -0,0 +1,18 @@
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: Python-2.7.2/Modules/Setup.dist
+===================================================================
+--- Python-2.7.2.orig/Modules/Setup.dist 2011-06-11 08:46:26.000000000 -0700
++++ Python-2.7.2/Modules/Setup.dist 2011-12-27 15:51:41.244623219 -0800
+@@ -248,7 +248,7 @@
+ # Message-Digest Algorithm, described in RFC 1321. The necessary files
+ # md5.c and md5.h are included here.
+
+-#_md5 md5module.c md5.c
++_md5 md5module.c md5.c
+
+
+ # The _sha module implements the SHA checksum algorithms.
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
new file mode 100644
index 000000000..e9bae324f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_parallel_make_races_on_pgen.patch
@@ -0,0 +1,27 @@
+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/avoid_warning_about_tkinter.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
new file mode 100644
index 000000000..3347321fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
@@ -0,0 +1,39 @@
+_tkinter module needs tk module along with tcl. tk is not yet integrated
+in yocto so we skip the check for this module.
+Avoid a warning by not adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Also simply disable the tk module since its not in DEPENDS.
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2012-04-05 23:18:38.500136647 +0300
++++ Python-2.7.2/setup.py 2012-04-05 23:19:35.888134969 +0300
+@@ -1634,8 +1634,10 @@
+ # Call the method for detecting whether _tkinter can be compiled
+ self.detect_tkinter(inc_dirs, lib_dirs)
+
+- if '_tkinter' not in [e.name for e in self.extensions]:
+- missing.append('_tkinter')
++ # tkinter module will not be avalaible as yocto
++ # doesn't have tk integrated (yet)
++ #if '_tkinter' not in [e.name for e in self.extensions]:
++ # missing.append('_tkinter')
+
+ return missing
+
+diff --git Python-3.5.1.orig/setup.py Python-3.5.1/setup.py
+index b4633b9..d7588c0 100644
+--- Python-3.5.1.orig/setup.py
++++ Python-3.5.1/setup.py
+@@ -1536,7 +1536,7 @@ class PyBuildExt(build_ext):
+ self.extensions.extend(exts)
+
+ # Call the method for detecting whether _tkinter can be compiled
+- self.detect_tkinter(inc_dirs, lib_dirs)
++ # self.detect_tkinter(inc_dirs, lib_dirs)
+
+ # tkinter module will not be avalaible as yocto
+ # doesn't have tk integrated (yet)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch
new file mode 100644
index 000000000..337e0e3e2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch
@@ -0,0 +1,23 @@
+sunaudiodev module is sunos specific so we avoid a warning by not
+adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2012-04-05 22:29:18.049196608 +0300
++++ Python-2.7.2/setup.py 2012-04-05 22:29:57.505195453 +0300
+@@ -1522,8 +1522,9 @@
+ if platform == 'sunos5':
+ # SunOS specific modules
+ exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
+- else:
+- missing.append('sunaudiodev')
++ # If platform is not sunos warning is useless
++ #else:
++ # missing.append('sunaudiodev')
+
+ if platform == 'darwin':
+ # _scproxy
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/builddir.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/builddir.patch
new file mode 100644
index 000000000..ad629a022
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/builddir.patch
@@ -0,0 +1,46 @@
+When cross compiling python, we used to need to install the Makefile, pyconfig.h
+and the python library to their final location before being able to compile the
+rest of python. This change allows us to point python at its own source when
+building, avoiding a variety of sysroot staging issues and simplifying the main
+python recipe.
+
+Upstream-Status: Inappropriate
+RP 2012/11/13
+
+Index: Python-2.7.9/Lib/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/sysconfig.py
++++ Python-2.7.9/Lib/sysconfig.py
+@@ -93,6 +93,7 @@ _PREFIX = os.path.normpath(sys.prefix)
+ _EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
+ _CONFIG_VARS = None
+ _USER_BASE = None
++_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None)
+
+ def _safe_realpath(path):
+ try:
+@@ -100,7 +101,9 @@ def _safe_realpath(path):
+ except OSError:
+ return path
+
+-if sys.executable:
++if _PYTHONBUILDDIR:
++ _PROJECT_BASE = _PYTHONBUILDDIR
++elif sys.executable:
+ _PROJECT_BASE = os.path.dirname(_safe_realpath(sys.executable))
+ else:
+ # sys.executable can be empty if argv[0] has been changed and Python is
+Index: Python-2.7.9/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.9/Lib/distutils/sysconfig.py
+@@ -26,6 +26,9 @@ EXEC_PREFIX = os.path.normpath(sys.exec_
+ # live in project/PCBuild9. If we're dealing with an x64 Windows build,
+ # it'll live in project/PCbuild/amd64.
+ project_base = os.path.dirname(os.path.abspath(sys.executable))
++_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None)
++if _PYTHONBUILDDIR:
++ project_base = _PYTHONBUILDDIR
+ if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
+ project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
+ # PC/VS7.1
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/cgi_py.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/cgi_py.patch
new file mode 100644
index 000000000..de504f9dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/cgi_py.patch
@@ -0,0 +1,23 @@
+Lib/cgi.py: Update the script as mentioned in the comment
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- Python-2.6.6/Lib/cgi.py.orig 2010-08-01 22:14:27.000000000 -0500
++++ Python-2.6.6/Lib/cgi.py 2011-09-21 15:28:40.478208631 -0500
+@@ -1,13 +1,4 @@
+-#! /usr/local/bin/python
+-
+-# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
+-# intentionally NOT "/usr/bin/env python". On many systems
+-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
+-# scripts, and /usr/local/bin is the default directory where Python is
+-# installed, so /usr/bin/env would be unable to find python. Granted,
+-# binary installations by Linux vendors often install Python in
+-# /usr/bin. So let those vendors patch cgi.py to match their choice
+-# of installation.
++#! /usr/bin/env python
+
+ """Support module for CGI (Common Gateway Interface) scripts.
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
new file mode 100644
index 000000000..e6d6c65bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
@@ -0,0 +1,57 @@
+Author: Andrei Gherzan <andrei@gherzan.ro>
+Date: Sun Mar 25 02:02:27 2012 +0200
+
+This patch was added for 64bit host machines. In the compile process python
+is checking if platform is a 64bit platform using sys.maxint which is the host's
+value. The patch fixes this issue so that python would check if TARGET machine
+is 64bit not the HOST machine. In this way will have "dl" and "imageop" modules
+built if HOST machine is 64bit but the target machine is 32bit.
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Upstream-Status: Pending
+
+Index: Python-2.7.11/setup.py
+===================================================================
+--- Python-2.7.11.orig/setup.py
++++ Python-2.7.11/setup.py
+@@ -35,6 +35,21 @@ COMPILED_WITH_PYDEBUG = ('--with-pydebug
+ # This global variable is used to hold the list of modules to be disabled.
+ disabled_module_list = []
+
++def target_is_64bit_platform ():
++ """
++ In case of cross-compile, some modules are not build as setup checks if HOST
++ is 64bit and not TARGET.
++ As python was built for TARGET we can check this in pyconfig.h in this way:
++ Sizeof LONG on a 32 bit platform is 4 bytes
++ Sizeof LONG on a 64 bit platform is 8 bytes
++ """
++ pyconf = open("pyconfig.h").read()
++ aux = re.search(r"#s*define\s+SIZEOF_LONG\s+8\s*", pyconf)
++ if aux is not None:
++ return True
++ else:
++ return False
++
+ def add_dir_to_list(dirlist, dir):
+ """Add the directory 'dir' to the list 'dirlist' (at the front) if
+ 1) 'dir' is not already in 'dirlist'
+@@ -716,7 +731,7 @@ class PyBuildExt(build_ext):
+ exts.append( Extension('audioop', ['audioop.c']) )
+
+ # Disabled on 64-bit platforms
+- if sys.maxsize != 9223372036854775807L:
++ if not target_is_64bit_platform():
+ # Operations on images
+ exts.append( Extension('imageop', ['imageop.c']) )
+ else:
+@@ -1545,7 +1560,7 @@ class PyBuildExt(build_ext):
+ missing.append('_codecs_%s' % loc)
+
+ # Dynamic loading module
+- if sys.maxint == 0x7fffffff:
++ if not target_is_64bit_platform():
+ # This requires sizeof(int) == sizeof(long) == sizeof(char*)
+ dl_inc = find_file('dlfcn.h', [], inc_dirs)
+ if (dl_inc is not None) and (host_platform not in ['atheos']):
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch
new file mode 100644
index 000000000..669112dab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch
@@ -0,0 +1,33 @@
+Add 'build-test' and 'runtest-TESTS' targets to Makefile, to build and run tests
+cross-compiled.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+---
+diff -ruN a/Makefile.pre.in b/Makefile.pre.in
+--- a/Makefile.pre.in 2013-06-27 10:44:11.033840532 +0200
++++ b/Makefile.pre.in 2013-06-27 10:44:39.572635273 +0200
+@@ -709,14 +709,19 @@
+ # generated bytecode. This is sometimes a very shy bug needing a lot of
+ # sample data.
+
+-TESTOPTS= -l $(EXTRATESTOPTS)
++TESTOPTS= -l -v $(EXTRATESTOPTS)
+ TESTPROG= $(srcdir)/Lib/test/regrtest.py
+-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
+-test: all platform
+- -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
++TESTPYTHON= $(RUNSHARED) $(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
++test: build-test
++ $(MAKE) runtest-TESTS
++
++runtest-TESTS:
++ -find $(srcdir) -name '*.py[co]' -print | xargs rm -f
+ -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
+ $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
+
++build-test: all platform
++
+ testall: all platform
+ -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
+ $(TESTPYTHON) $(srcdir)/Lib/compileall.py
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch
new file mode 100644
index 000000000..e4262d9ef
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch
@@ -0,0 +1,77 @@
+Upstream-Status: Inappropriate [Embedded specific]
+
+This patch fixes issuing with different libdir like lib64.
+This patch makes the native python binary modules findable
+in the install process of the host python.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/03/14
+
+Updated for python 2.7.3
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/05/01
+
+Rebased for python-2.7.9
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+
+Index: Python-2.7.9/Lib/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/sysconfig.py
++++ Python-2.7.9/Lib/sysconfig.py
+@@ -9,7 +9,7 @@ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
++ 'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{base}/include/python{py_version_short}',
+ 'platinclude': '{platbase}/include/python{py_version_short}',
+@@ -67,7 +67,7 @@ _INSTALL_SCHEMES = {
+ 'posix_user': {
+ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
++ 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -1046,27 +1046,27 @@ libinstall: build_all $(srcdir)/Lib/$(PL
+ $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH}$(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/host_include_contamination.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/host_include_contamination.patch
new file mode 100644
index 000000000..e0aafb218
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/host_include_contamination.patch
@@ -0,0 +1,28 @@
+when building python for qemux86-64 on ubuntu 11.10/64bit
+it gropes into host includes and then mixes them with cross
+includes and as a result some modules fail to compile and link
+one of the modules is python-elementtree which is then not
+found during image creation
+
+Proble is that setup.py tries to add native includes that newer
+ubuntu has introduced for multiarch support. But that should
+only happen for native builds and not cross building python
+so we add a check here.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+
+diff --git a/setup.py b/setup.py
+index ba2d242..bf859be 100644
+--- a/setup.py
++++ b/setup.py
+@@ -393,6 +393,8 @@ class PyBuildExt(build_ext):
+
+ if not find_executable('dpkg-architecture'):
+ return
++ if os.environ.get('CROSS_COMPILE') is not None:
++ return
+ opt = ''
+ if cross_compiling:
+ opt = '-t' + sysconfig.get_config_var('HOST_GNU_TYPE')
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
new file mode 100644
index 000000000..0bfa0d2cf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/multilib.patch
@@ -0,0 +1,296 @@
+Rebased for python-2.7.9
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/configure.ac
+===================================================================
+--- Python-2.7.9.orig/configure.ac
++++ Python-2.7.9/configure.ac
+@@ -736,6 +736,10 @@ SunOS*)
+ ;;
+ esac
+
++AC_SUBST(LIB)
++AC_MSG_CHECKING(LIB)
++LIB=`basename ${libdir}`
++AC_MSG_RESULT($LIB)
+
+ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+Index: Python-2.7.9/Include/pythonrun.h
+===================================================================
+--- Python-2.7.9.orig/Include/pythonrun.h
++++ Python-2.7.9/Include/pythonrun.h
+@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
+ /* In their own files */
+ PyAPI_FUNC(const char *) Py_GetVersion(void);
+ PyAPI_FUNC(const char *) Py_GetPlatform(void);
++PyAPI_FUNC(const char *) Py_GetLib(void);
+ 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.9/Lib/distutils/command/install.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/command/install.py
++++ Python-2.7.9/Lib/distutils/command/install.py
+@@ -22,6 +22,8 @@ from site import USER_BASE
+ from site import USER_SITE
+
+
++libname = sys.lib
++
+ if sys.version < "2.2":
+ WINDOWS_SCHEME = {
+ 'purelib': '$base',
+@@ -42,7 +44,7 @@ else:
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+ 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
++ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+Index: Python-2.7.9/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.9/Lib/distutils/sysconfig.py
+@@ -119,8 +119,11 @@ def get_python_lib(plat_specific=0, stan
+ prefix = plat_specific and EXEC_PREFIX or PREFIX
+
+ if os.name == "posix":
+- libpython = os.path.join(prefix,
+- "lib", "python" + get_python_version())
++ if plat_specific or standard_lib:
++ lib = sys.lib
++ else:
++ lib = "lib"
++ libpython = os.path.join(prefix, lib, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+Index: Python-2.7.9/Lib/pydoc.py
+===================================================================
+--- Python-2.7.9.orig/Lib/pydoc.py
++++ Python-2.7.9/Lib/pydoc.py
+@@ -383,7 +383,7 @@ class Doc:
+
+ 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.9/Lib/site.py
+===================================================================
+--- Python-2.7.9.orig/Lib/site.py
++++ Python-2.7.9/Lib/site.py
+@@ -288,13 +288,18 @@ def getsitepackages():
+ if sys.platform in ('os2emx', 'riscos'):
+ sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
+ elif os.sep == '/':
+- sitepackages.append(os.path.join(prefix, "lib",
++ sitepackages.append(os.path.join(prefix, sys.lib,
+ "python" + sys.version[:3],
+ "site-packages"))
+- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
++ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
++ if sys.lib != "lib":
++ sitepackages.append(os.path.join(prefix, "lib",
++ "python" + sys.version[:3],
++ "site-packages"))
++ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
+ else:
+ 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.9/Lib/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/sysconfig.py
++++ Python-2.7.9/Lib/sysconfig.py
+@@ -7,10 +7,10 @@ from os.path import pardir, realpath
+
+ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+- 'stdlib': '{base}/lib/python{py_version_short}',
+- 'platstdlib': '{platbase}/lib/python{py_version_short}',
++ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
++ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+ 'purelib': '{base}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
++ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{base}/include/python{py_version_short}',
+ 'platinclude': '{platbase}/include/python{py_version_short}',
+ 'scripts': '{base}/bin',
+@@ -65,10 +65,10 @@ _INSTALL_SCHEMES = {
+ 'data' : '{userbase}',
+ },
+ 'posix_user': {
+- 'stdlib': '{userbase}/lib/python{py_version_short}',
+- 'platstdlib': '{userbase}/lib/python{py_version_short}',
++ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
++ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+ 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
++ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+ 'data' : '{userbase}',
+Index: Python-2.7.9/Lib/test/test_dl.py
+===================================================================
+--- Python-2.7.9.orig/Lib/test/test_dl.py
++++ Python-2.7.9/Lib/test/test_dl.py
+@@ -4,10 +4,11 @@
+ import unittest
+ from test.test_support import verbose, import_module
+ dl = import_module('dl', deprecated=True)
++import sys
+
+ sharedlibs = [
+- ('/usr/lib/libc.so', 'getpid'),
+- ('/lib/libc.so.6', 'getpid'),
++ ('/usr/'+sys.lib+'/libc.so', 'getpid'),
++ ('/'+sys.lib+'/libc.so.6', 'getpid'),
+ ('/usr/bin/cygwin1.dll', 'getpid'),
+ ('/usr/lib/libc.dylib', 'getpid'),
+ ]
+Index: Python-2.7.9/Lib/test/test_site.py
+===================================================================
+--- Python-2.7.9.orig/Lib/test/test_site.py
++++ Python-2.7.9/Lib/test/test_site.py
+@@ -241,12 +241,16 @@ class HelperFunctionsTests(unittest.Test
+ self.assertEqual(dirs[2], wanted)
+ elif os.sep == '/':
+ # OS X non-framwework builds, Linux, FreeBSD, etc
+- self.assertEqual(len(dirs), 2)
+ wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
+ 'site-packages')
+- self.assertEqual(dirs[0], wanted)
++ self.assertTrue(wanted in dirs)
+ wanted = os.path.join('xoxo', 'lib', 'site-python')
+- self.assertEqual(dirs[1], wanted)
++ self.assertTrue(wanted in dirs)
++ wanted = os.path.join('xoxo', sys.lib, 'python' + sys.version[:3],
++ 'site-packages')
++ self.assertTrue(wanted in dirs)
++ wanted = os.path.join('xoxo', sys.lib, 'site-python')
++ self.assertTrue(wanted in dirs)
+ else:
+ # other platforms
+ self.assertEqual(len(dirs), 2)
+Index: Python-2.7.9/Lib/trace.py
+===================================================================
+--- Python-2.7.9.orig/Lib/trace.py
++++ Python-2.7.9/Lib/trace.py
+@@ -754,10 +754,10 @@ def main(argv=None):
+ # should I also call expanduser? (after all, could use $HOME)
+
+ s = s.replace("$prefix",
+- os.path.join(sys.prefix, "lib",
++ os.path.join(sys.prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = s.replace("$exec_prefix",
+- os.path.join(sys.exec_prefix, "lib",
++ os.path.join(sys.exec_prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = os.path.normpath(s)
+ ignore_dirs.append(s)
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -87,6 +87,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
+
+ # Machine-dependent subdirectories
+ MACHDEP= @MACHDEP@
++LIB= @LIB@
+
+ # Multiarch directory (may be empty)
+ MULTIARCH= @MULTIARCH@
+@@ -106,7 +107,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/@LIB@
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+@@ -598,6 +599,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
+ -DEXEC_PREFIX='"$(exec_prefix)"' \
+ -DVERSION='"$(VERSION)"' \
+ -DVPATH='"$(VPATH)"' \
++ -DLIB='"$(LIB)"' \
+ -o $@ $(srcdir)/Modules/getpath.c
+
+ Modules/python.o: $(srcdir)/Modules/python.c
+@@ -640,7 +642,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
+- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
++ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
+
+ Python/importdl.o: $(srcdir)/Python/importdl.c
+ $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+Index: Python-2.7.9/Modules/getpath.c
+===================================================================
+--- Python-2.7.9.orig/Modules/getpath.c
++++ Python-2.7.9/Modules/getpath.c
+@@ -116,9 +116,11 @@
+ #define EXEC_PREFIX PREFIX
+ #endif
+
++#define LIB_PYTHON LIB "/python" VERSION
++
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
+ #endif
+
+ #ifndef LANDMARK
+@@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = LIB_PYTHON;
+
+ static void
+ reduce(char *dir)
+Index: Python-2.7.9/Python/getplatform.c
+===================================================================
+--- Python-2.7.9.orig/Python/getplatform.c
++++ Python-2.7.9/Python/getplatform.c
+@@ -10,3 +10,13 @@ Py_GetPlatform(void)
+ {
+ return PLATFORM;
+ }
++
++#ifndef LIB
++#define LIB "lib"
++#endif
++
++const char *
++Py_GetLib(void)
++{
++ return LIB;
++}
+Index: Python-2.7.9/Python/sysmodule.c
+===================================================================
+--- Python-2.7.9.orig/Python/sysmodule.c
++++ Python-2.7.9/Python/sysmodule.c
+@@ -1437,6 +1437,8 @@ _PySys_Init(void)
+ PyString_FromString(Py_GetCopyright()));
+ SET_SYS_FROM_STRING("platform",
+ PyString_FromString(Py_GetPlatform()));
++ SET_SYS_FROM_STRING("lib",
++ PyString_FromString(Py_GetLib()));
+ SET_SYS_FROM_STRING("executable",
+ PyString_FromString(Py_GetProgramFullPath()));
+ SET_SYS_FROM_STRING("prefix",
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch
new file mode 100644
index 000000000..951cb466f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch
@@ -0,0 +1,19 @@
+When using make -j with the 'install' target, it's possible for altbininstall
+(which normally creates BINDIR) and libainstall (which doesn't, though it
+installs python-config there) to race, resulting in a failure due to
+attempting to install python-config into a nonexistent BINDIR. Ensure it also
+exists in the libainstall target.
+
+Upstream-Status: Pending
+
+--- Python-2.7.3.orig/Makefile.pre.in
++++ Python-2.7.3/Makefile.pre.in
+@@ -1008,7 +1008,7 @@ LIBPL= $(LIBP)/config
+ LIBPC= $(LIBDIR)/pkgconfig
+
+ libainstall: all python-config
+- @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
++ @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC) $(BINDIR); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+ echo "Creating directory $$i"; \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch
new file mode 100644
index 000000000..216be0a44
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Remove the RPATH to avoid QA issue warning.
+
+RP: Added secondary unnecessary rpath to the list 2012/8/7
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+
+Index: Python-2.7.3/setup.py
+===================================================================
+--- Python-2.7.3.orig/setup.py 2012-08-07 10:41:58.560132529 +0000
++++ Python-2.7.3/setup.py 2012-08-07 11:09:47.852094515 +0000
+@@ -1042,7 +1042,6 @@
+ exts.append(Extension('_bsddb', ['_bsddb.c'],
+ depends = ['bsddb.h'],
+ library_dirs=dblib_dir,
+- runtime_library_dirs=dblib_dir,
+ include_dirs=db_incs,
+ libraries=dblibs))
+ else:
+@@ -1252,7 +1251,6 @@
+ print "building dbm using bdb"
+ dbmext = Extension('dbm', ['dbmmodule.c'],
+ library_dirs=dblib_dir,
+- runtime_library_dirs=dblib_dir,
+ include_dirs=db_incs,
+ define_macros=[
+ ('HAVE_BERKDB_H', None),
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/python/python/run-ptest
new file mode 100644
index 000000000..a2f9eed44
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+#This script is used to run python test suites
+
+make -f LIBDIR/python/ptest/Makefile -k runtest-TESTS srcdir=LIBDIR/python2.7 TESTPROG=LIBDIR/python2.7/test/regrtest.py | sed -e '/\.\.\. ok/ s/^/PASS: /g' -e '/\.\.\. [ERROR|FAIL]/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
new file mode 100644
index 000000000..dacb552ec
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
@@ -0,0 +1,35 @@
+python should search for db.h in inc_dirs and not in a hardcoded path.
+If db.h is found but HASHVERSION is not 2 we avoid a warning by not
+adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+
+diff --git a/setup.py b/setup.py
+index b887808..ae51607 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1237,6 +1237,8 @@ class PyBuildExt(build_ext):
+ # the more recent berkeleydb's db.h file first in the include path
+ # when attempting to compile and it will fail.
+ f = "/usr/include/db.h"
++ if len(inc_dirs) != 0:
++ f = os.path.join(inc_dirs[0], "db.h")
+
+ if host_platform == 'darwin':
+ if is_macosx_sdk_path(f):
+@@ -1257,8 +1259,10 @@ class PyBuildExt(build_ext):
+ libraries=libraries))
+ else:
+ exts.append(Extension('bsddb185', ['bsddbmodule.c']))
+- else:
+- missing.append('bsddb185')
++ # If a newer version is detected don't report an useless
++ # warning
++ #else:
++ # missing.append('bsddb185')
+ else:
+ missing.append('bsddb185')
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
new file mode 100644
index 000000000..6ccdb948b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
@@ -0,0 +1,27 @@
+This patch skips over the 'import check' setup.py does when building
+extensions. This generally won't work when cross-compiling.
+
+Upstream-Status: Inappropriate [embedded-specific]
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2011-11-04 16:46:34.553796410 -0500
++++ Python-2.7.2/setup.py 2011-11-04 16:59:49.692802313 -0500
+@@ -287,6 +287,15 @@
+ (ext.name, sys.exc_info()[1]))
+ self.failed.append(ext.name)
+ return
++
++ # If we're cross-compiling, we want to skip the import check
++ # i.e. we shouldn't be dynamically loading target shared libs
++ if os.environ.get('CROSS_COMPILE') is not None:
++ self.announce(
++ 'WARNING: skipping import check for cross-compiled "%s"' %
++ ext.name)
++ return
++
+ # Workaround for Mac OS X: The Carbon-based modules cannot be
+ # reliably imported into a command-line Python
+ if 'Carbon' in ext.extra_link_args:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/setuptweaks.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/setuptweaks.patch
new file mode 100644
index 000000000..3a91b1916
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/setuptweaks.patch
@@ -0,0 +1,57 @@
+This patch removes various ways native system options can pass into the python
+compilation and somehow break C modules.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2012/04/23
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2012-04-23 20:03:47.295582553 +0000
++++ Python-2.7.2/setup.py 2012-04-23 20:03:15.000000000 +0000
+@@ -231,7 +231,13 @@
+ # compilers
+ if compiler is not None:
+ (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
+- args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
++ # Need to filter out -isysroot from the flags. Ideally should
++ # figure out target flags here.
++ flags = []
++ for f in cflags.split():
++ if not f.startswith("-isystem"):
++ flags.append(f)
++ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + ' '.join(flags)
+ self.compiler.set_executables(**args)
+
+ build_ext.build_extensions(self)
+@@ -393,7 +399,6 @@
+ # into configure and stored in the Makefile (issue found on OS X 10.3).
+ for env_var, arg_name, dir_list in (
+ ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
+- ('LDFLAGS', '-L', self.compiler.library_dirs),
+ ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+ env_val = sysconfig.get_config_var(env_var)
+ if env_val:
+@@ -419,16 +424,16 @@
+ for directory in reversed(options.dirs):
+ add_dir_to_list(dir_list, directory)
+
+- if os.path.normpath(sys.prefix) != '/usr' \
+- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++# if os.path.normpath(sys.prefix) != '/usr' \
++# and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+ # building a framework with different architectures than
+ # the one that is currently installed (issue #7473)
+- add_dir_to_list(self.compiler.library_dirs,
+- sysconfig.get_config_var("LIBDIR"))
+- add_dir_to_list(self.compiler.include_dirs,
+- sysconfig.get_config_var("INCLUDEDIR"))
++# add_dir_to_list(self.compiler.library_dirs,
++# sysconfig.get_config_var("LIBDIR"))
++# add_dir_to_list(self.compiler.include_dirs,
++# sysconfig.get_config_var("INCLUDEDIR"))
+
+ try:
+ have_unicode = unicode
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/sitecustomize.py b/import-layers/yocto-poky/meta/recipes-devtools/python/python/sitecustomize.py
new file mode 100644
index 000000000..273901898
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/sitecustomize.py
@@ -0,0 +1,45 @@
+# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# GPLv2 or later
+# Version: 20081123
+# Features:
+# * set proper default encoding
+# * enable readline completion in the interactive interpreter
+# * load command line history on startup
+# * save command line history on exit
+
+import os
+
+def __exithandler():
+ try:
+ readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+def __registerExitHandler():
+ import atexit
+ atexit.register( __exithandler )
+
+def __enableReadlineSupport():
+ readline.set_history_length( 1000 )
+ readline.parse_and_bind( "tab: complete" )
+ try:
+ readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+def __enableDefaultEncoding():
+ import sys
+ try:
+ sys.setdefaultencoding( "utf8" )
+ except LookupError:
+ pass
+
+import sys
+try:
+ import rlcompleter, readline
+except ImportError:
+ pass
+else:
+ __enableDefaultEncoding()
+ __registerExitHandler()
+ __enableReadlineSupport()
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch
new file mode 100644
index 000000000..2c657861c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch
@@ -0,0 +1,20 @@
+Python tries to use ncursesw from the host,
+if it is not found causes an error on configure,
+we should use ncursesw from sysroot instead
+
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/configure.ac
+===================================================================
+--- Python-2.7.9.orig/configure.ac
++++ Python-2.7.9/configure.ac
+@@ -4311,7 +4311,7 @@ fi
+
+ # first curses configure check
+ ac_save_cppflags="$CPPFLAGS"
+-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
++CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw"
+
+ AC_CHECK_HEADERS(curses.h ncurses.h)
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.1.bb
new file mode 100644
index 000000000..7bad11aaf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.1.bb
@@ -0,0 +1,79 @@
+require recipes-devtools/python/python.inc
+
+PR = "${INC_PR}.0"
+PYTHON_MAJMIN = "3.5"
+DISTRO_SRC_URI ?= "file://sitecustomize.py"
+DISTRO_SRC_URI_linuxstdbase = ""
+SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
+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 \
+file://110-enable-zlib.patch \
+file://130-readline-setup.patch \
+file://150-fix-setupterm.patch \
+file://python-3.3-multilib.patch \
+file://03-fix-tkinter-detection.patch \
+file://avoid_warning_about_tkinter.patch \
+file://shutil-follow-symlink-fix.patch \
+file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
+file://sysroot-include-headers.patch \
+file://unixccompiler.patch \
+${DISTRO_SRC_URI} \
+file://sysconfig.py-add-_PYTHON_PROJECT_SRC.patch \
+file://setup.py-check-cross_compiling-when-get-FLAGS.patch \
+file://0001-Do-not-use-the-shell-version-of-python-config-that-w.patch \
+"
+SRC_URI[md5sum] = "e9ea6f2623fffcdd871b7b19113fde80"
+SRC_URI[sha256sum] = "c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=dd98d01d471fac8d8dbdd975229dba03"
+
+# exclude pre-releases for both python 2.x and 3.x
+UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
+
+S = "${WORKDIR}/Python-${PV}"
+
+EXTRANATIVEPATH += "bzip2-native"
+DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native"
+
+inherit native
+
+RPROVIDES += "python3-distutils-native python3-compression-native python3-textutils-native python3-core-native"
+
+EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --without-ensurepip"
+
+EXTRA_OEMAKE = '\
+ BUILD_SYS="" \
+ HOST_SYS="" \
+ LIBC="" \
+ STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
+ STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+'
+
+# No ctypes option for python 3
+PYTHONLSBOPTS = ""
+
+do_configure_append() {
+ autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+}
+
+do_install() {
+ install -d ${D}${libdir}/pkgconfig
+ oe_runmake 'DESTDIR=${D}' install
+ if [ -e ${WORKDIR}/sitecustomize.py ]; then
+ install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
+ fi
+ 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 python3|' $PYTHSCRIPT
+ done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_8.0.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_8.0.0.bb
new file mode 100644
index 000000000..834ecda6d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-pip_8.0.0.bb
@@ -0,0 +1,48 @@
+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 = " \
+ http://pypi.python.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
+"
+SRC_URI[md5sum] = "5601c4323464add1482291634142894d"
+SRC_URI[sha256sum] = "90112b296152f270cb8dddcd19b7b87488d9e002e8cf622e14c4da9c2f6319b1"
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/pip"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils3
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
+
+do_install_prepend() {
+ install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
+}
+
+# Use setuptools site.py instead, avoid shared state issue
+do_install_append() {
+ rm ${D}/${libdir}/${PYTHON_DIR}/site-packages/site.py
+ rm ${D}/${libdir}/${PYTHON_DIR}/site-packages/__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-setuptools_19.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-setuptools_19.4.bb
new file mode 100644
index 000000000..fb2931c3f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-setuptools_19.4.bb
@@ -0,0 +1,37 @@
+require python-setuptools.inc
+
+DEPENDS += "python3"
+DEPENDS_class-native += "python3-native"
+
+inherit distutils3
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
+
+# The installer puts the wrong path in the setuptools.pth file. Correct it.
+do_install_append() {
+ rm ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
+ mv ${D}${bindir}/easy_install ${D}${bindir}/easy3_install
+ echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
+}
+
+RDEPENDS_${PN} = "\
+ python3-distutils \
+ python3-compression \
+"
+RDEPENDS_${PN}_class-target = "\
+ python3-ctypes \
+ python3-distutils \
+ python3-email \
+ python3-importlib \
+ python3-numbers \
+ python3-compression \
+ python3-shell \
+ python3-subprocess \
+ python3-textutils \
+ python3-pkgutil \
+ python3-threading \
+ python3-misc \
+ python3-unittest \
+ python3-xml \
+"
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/000-cross-compile.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/000-cross-compile.patch
new file mode 100644
index 000000000..28fe70adb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/000-cross-compile.patch
@@ -0,0 +1,85 @@
+We cross compile python. This patch uses tools from host/native
+python instead of in-tree tools
+
+-Khem
+
+Upstream-Status: Inappropriate[Configuration Specific]
+
+---
+ Makefile.pre.in | 25 +++++++++++++------------
+ 1 file changed, 13 insertions(+), 12 deletions(-)
+
+Index: Python-3.5.1/Makefile.pre.in
+===================================================================
+--- Python-3.5.1.orig/Makefile.pre.in
++++ Python-3.5.1/Makefile.pre.in
+@@ -220,6 +220,7 @@ LIBOBJS= @LIBOBJS@
+
+ PYTHON= python$(EXE)
+ BUILDPYTHON= python$(BUILDEXE)
++HOSTPYTHON= $(BUILDPYTHON)
+
+ PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
+ _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
+@@ -276,6 +277,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
+ ##########################################################################
+ # Parser
+ PGEN= Parser/pgen$(EXE)
++HOSTPGEN= $(PGEN)$(EXE)
+
+ PSRCS= \
+ Parser/acceler.c \
+@@ -506,7 +508,7 @@ build_all_generate_profile:
+
+ run_profile_task:
+ : # FIXME: can't run for a cross build
+- $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
++ $(LLVM_PROF_FILE) $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK) || true
+
+ build_all_merge_profile:
+ $(LLVM_PROF_MERGER)
+@@ -779,7 +781,7 @@ $(IO_OBJS): $(IO_H)
+
+ $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
+ @$(MKDIR_P) Include
+- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
++ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(GRAMMAR_C): $(GRAMMAR_H)
+ touch $(GRAMMAR_C)
+
+@@ -968,7 +970,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Programs/pyth
+ ######################################################################
+
+ TESTOPTS= $(EXTRATESTOPTS)
+-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS)
++TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS)
+ TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
+ TESTTIMEOUT= 3600
+
+@@ -1455,7 +1457,7 @@ frameworkinstallstructure: $(LDLIBRARY)
+ fi; \
+ done
+ $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
+- sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
++ sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
+ $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
+ $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
+ $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
+@@ -1521,7 +1523,7 @@ config.status: $(srcdir)/configure
+
+ # Run reindent on the library
+ reindent:
+- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
++ $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
+
+ # Rerun configure with the same options as it was run last time,
+ # provided the config.status script exists
+@@ -1656,7 +1658,7 @@ funny:
+
+ # Perform some verification checks on any modified files.
+ patchcheck: all
+- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
++ $(RUNSHARED) ./$(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
+
+ # Dependencies
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
new file mode 100644
index 000000000..b7e0ac635
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
@@ -0,0 +1,38 @@
+From 045c99b5f1eb6e4e0d8ad1ef9f0ba6574f738150 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 23 Oct 2015 12:25:09 +0300
+Subject: [PATCH] Do not use the shell version of python-config that was
+ introduced in 3.4
+
+Revert instead to the original python version: it has our tweaks and
+outputs directories correctly.
+
+Upstream-Status: Inappropriate [oe-specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Makefile.pre.in | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index d7fc9a0..47e60bc 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1270,12 +1270,9 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
+ sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
+ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
+ sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
+- # On Darwin, always use the python version of the script, the shell
+- # version doesn't use the compiler customizations that are provided
+- # in python (_osx_support.py).
+- if test `uname -s` = Darwin; then \
+- cp python-config.py python-config; \
+- fi
++ # In OpenEmbedded, always use the python version of the script, the shell
++ # version is broken in multiple ways, and doesn't return correct directories
++ cp python-config.py python-config
+
+
+ # Install the include files
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch
new file mode 100644
index 000000000..dd6b24fe9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch
@@ -0,0 +1,37 @@
+From 2f5a4c708d90fa8db21f446ae879cff79387448d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 20 May 2013 21:03:16 -0700
+Subject: [PATCH] h2py: Fix issue 13032 where it fails with UnicodeDecodeError
+
+use utf-8 to open the files
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ Tools/scripts/h2py.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py
+index 4f871d9..a53fbe0 100755
+--- a/Tools/scripts/h2py.py
++++ b/Tools/scripts/h2py.py
+@@ -69,13 +69,13 @@ def main():
+ sys.stdout.write('# Generated by h2py from stdin\n')
+ process(sys.stdin, sys.stdout)
+ else:
+- fp = open(filename, 'r')
++ fp = open(filename, 'r', encoding='utf-8')
+ outfile = os.path.basename(filename)
+ i = outfile.rfind('.')
+ if i > 0: outfile = outfile[:i]
+ modname = outfile.upper()
+ outfile = modname + '.py'
+- outfp = open(outfile, 'w')
++ outfp = open(outfile, 'w', encoding='utf-8')
+ outfp.write('# Generated by h2py from %s\n' % filename)
+ filedict = {}
+ for dir in searchdirs:
+--
+1.8.1.2
+
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
new file mode 100644
index 000000000..819ba69ed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch
@@ -0,0 +1,48 @@
+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/03-fix-tkinter-detection.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch
new file mode 100644
index 000000000..fddfd2b2f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+# We need to supply STAGING_INCDIR here, otherwise the Tk headers
+# will not be found.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille.de>
+
+Index: Python-3.3.0rc2/setup.py
+===================================================================
+--- Python-3.3.0rc2.orig/setup.py 2012-09-20 15:24:14.009124003 -0700
++++ Python-3.3.0rc2/setup.py 2012-09-20 15:25:08.449124963 -0700
+@@ -1620,7 +1620,7 @@
+ dotversion = dotversion[:-1] + '.' + dotversion[-1]
+ tcl_include_sub = []
+ tk_include_sub = []
+- for dir in inc_dirs:
++ for dir in [os.getenv("STAGING_INCDIR")]:
+ tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
+ tk_include_sub += [dir + os.sep + "tk" + dotversion]
+ tk_include_sub += tcl_include_sub
+@@ -1639,22 +1639,6 @@
+ if dir not in include_dirs:
+ include_dirs.append(dir)
+
+- # Check for various platform-specific directories
+- if host_platform == 'sunos5':
+- include_dirs.append('/usr/openwin/include')
+- added_lib_dirs.append('/usr/openwin/lib')
+- elif os.path.exists('/usr/X11R6/include'):
+- include_dirs.append('/usr/X11R6/include')
+- added_lib_dirs.append('/usr/X11R6/lib64')
+- added_lib_dirs.append('/usr/X11R6/lib')
+- elif os.path.exists('/usr/X11R5/include'):
+- include_dirs.append('/usr/X11R5/include')
+- added_lib_dirs.append('/usr/X11R5/lib')
+- else:
+- # Assume default location for X11
+- include_dirs.append('/usr/X11/include')
+- added_lib_dirs.append('/usr/X11/lib')
+-
+ # If Cygwin, then verify that X is installed before proceeding
+ if host_platform == 'cygwin':
+ x11_inc = find_file('X11/Xlib.h', [], include_dirs)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch
new file mode 100644
index 000000000..6beac7b80
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch
@@ -0,0 +1,33 @@
+Do not hardcode /usr into include paths when cross compiling
+
+-Khem
+
+Upstream-Status: Pending
+
+---
+ setup.py | 15 ++-------------
+ 1 file changed, 2 insertions(+), 13 deletions(-)
+
+Index: Python-3.3.2/setup.py
+===================================================================
+--- Python-3.3.2.orig/setup.py
++++ Python-3.3.2/setup.py
+@@ -444,7 +444,8 @@ class PyBuildExt(build_ext):
+ # only change this for cross builds for 3.3, issues on Mageia
+ if cross_compiling:
+ self.add_gcc_paths()
+- self.add_multiarch_paths()
++ if not cross_compiling:
++ self.add_multiarch_paths()
+
+ # Add paths specified in the environment variables LDFLAGS and
+ # CPPFLAGS for header and library files.
+@@ -480,7 +481,7 @@ class PyBuildExt(build_ext):
+ for directory in reversed(options.dirs):
+ add_dir_to_list(dir_list, directory)
+
+- if os.path.normpath(sys.base_prefix) != '/usr' \
++ if not cross_compiling and os.path.normpath(sys.base_prefix) != '/usr' \
+ and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch
new file mode 100644
index 000000000..789929b71
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch
@@ -0,0 +1,36 @@
+consider opkg directories when cleaning up
+
+-Khem
+
+Upstream-Status: Inappropriate [OE specific]
+
+---
+ Makefile.pre.in | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1306,8 +1306,8 @@ touch:
+ # Sanitation targets -- clean leaves libraries, executables and tags
+ # files, which clobber removes as well
+ pycremoval:
+- -find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';'
+- -find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
++ -find $(srcdir) ! -path './ipkg-install/*' -depth -name '__pycache__' -exec rm -rf {} ';'
++ -find $(srcdir) ! -path './ipkg-install/*' -name '*.py[co]' -exec rm -f {} ';'
+
+ rmtestturds:
+ -rm -f *BAD *GOOD *SKIPPED
+@@ -1321,9 +1321,9 @@ docclean:
+ -rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils
+
+ clean: pycremoval
+- find . -name '*.[oa]' -exec rm -f {} ';'
+- find . -name '*.s[ol]' -exec rm -f {} ';'
+- find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
++ find . ! -path './ipkg-install/*' -name '*.[oa]' -exec rm -f {} ';'
++ find . ! -path './ipkg-install/*' -name '*.s[ol]' -exec rm -f {} ';'
++ find . ! -path './ipkg-install/*' -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
+ find build -name 'fficonfig.h' -exec rm -f {} ';' || true
+ find build -name 'fficonfig.py' -exec rm -f {} ';' || true
+ -rm -f Lib/lib2to3/*Grammar*.pickle
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
new file mode 100644
index 000000000..b96419a63
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
@@ -0,0 +1,92 @@
+do not "adjust" python files before copying
+
+-Khem
+
+Upstream-Status: Inappropriate [Embedded-Specific]
+
+---
+ Lib/distutils/command/build_scripts.py | 43 +++------------------------------
+ 1 file changed, 4 insertions(+), 39 deletions(-)
+
+--- a/Lib/distutils/command/build_scripts.py
++++ b/Lib/distutils/command/build_scripts.py
+@@ -51,10 +51,7 @@ class build_scripts(Command):
+
+
+ def copy_scripts(self):
+- """Copy each script listed in 'self.scripts'; if it's marked as a
+- Python script in the Unix way (first line matches 'first_line_re',
+- ie. starts with "\#!" and contains "python"), then adjust the first
+- line to refer to the current Python interpreter as we copy.
++ """Copy each script listed in 'self.scripts'
+ """
+ self.mkpath(self.build_dir)
+ outfiles = []
+@@ -78,64 +75,10 @@ class build_scripts(Command):
+ if not self.dry_run:
+ raise
+ f = None
+- else:
+- encoding, lines = tokenize.detect_encoding(f.readline)
+- f.seek(0)
+- first_line = f.readline()
+- if not first_line:
+- self.warn("%s is an empty file (skipping)" % script)
+- continue
+-
+- match = first_line_re.match(first_line)
+- if match:
+- adjust = True
+- post_interp = match.group(1) or b''
+-
+- if adjust:
+- log.info("copying and adjusting %s -> %s", script,
+- self.build_dir)
+- updated_files.append(outfile)
+- if not self.dry_run:
+- if not sysconfig.python_build:
+- executable = self.executable
+- else:
+- executable = os.path.join(
+- sysconfig.get_config_var("BINDIR"),
+- "python%s%s" % (sysconfig.get_config_var("VERSION"),
+- sysconfig.get_config_var("EXE")))
+- executable = os.fsencode(executable)
+- shebang = b"#!" + executable + post_interp + b"\n"
+- # Python parser starts to read a script using UTF-8 until
+- # it gets a #coding:xxx cookie. The shebang has to be the
+- # first line of a file, the #coding:xxx cookie cannot be
+- # written before. So the shebang has to be decodable from
+- # UTF-8.
+- try:
+- shebang.decode('utf-8')
+- except UnicodeDecodeError:
+- raise ValueError(
+- "The shebang ({!r}) is not decodable "
+- "from utf-8".format(shebang))
+- # If the script is encoded to a custom encoding (use a
+- # #coding:xxx cookie), the shebang has to be decodable from
+- # the script encoding too.
+- try:
+- shebang.decode(encoding)
+- except UnicodeDecodeError:
+- raise ValueError(
+- "The shebang ({!r}) is not decodable "
+- "from the script encoding ({})"
+- .format(shebang, encoding))
+- with open(outfile, "wb") as outf:
+- outf.write(shebang)
+- outf.writelines(f.readlines())
+- if f:
+- f.close()
+- else:
+- if f:
++ if f:
+ f.close()
+- updated_files.append(outfile)
+- self.copy_file(script, outfile)
++ updated_files.append(outfile)
++ self.copy_file(script, outfile)
+
+ if os.name == 'posix':
+ for file in outfiles:
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/110-enable-zlib.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/110-enable-zlib.patch
new file mode 100644
index 000000000..fb92a1916
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/110-enable-zlib.patch
@@ -0,0 +1,21 @@
+Enable zlib in python
+
+-Khem
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+---
+ Modules/Setup.dist | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -354,7 +354,7 @@ _symtable symtablemodule.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -lz
+
+ # Interface to the Expat XML parser
+ #
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
new file mode 100644
index 000000000..8b93c1cf4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
@@ -0,0 +1,88 @@
+From d4dd67daa1555bf13272cc071706338572539bad 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/20] python3: Add target and native recipes
+
+Upstream-Status: Inappropriate [embedded specific]
+
+02/2015 Rebased for Python 3.4.2
+
+# The proper prefix is inside our staging area.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+# Signed-off-by: Phil Blundell <philb@gnu.org>
+# Signed-off-by: Khem Raj <raj.khem@gmail.com>
+# Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+---
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 573724d..418b478 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -17,10 +17,11 @@ import sys
+ from .errors import DistutilsPlatformError
+
+ # These are needed in a couple of spots, so just compute them once.
+-PREFIX = os.path.normpath(sys.prefix)
+-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
+-BASE_PREFIX = os.path.normpath(sys.base_prefix)
+-BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
++PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++BASE_PREFIX = os.path.normpath(sys.base_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++BASE_EXEC_PREFIX= os.path.normpath(sys.base_exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++
+
+ # Path to the base directory of the project. On Windows the binary may
+ # live in project/PCBuild/win32 or project/PCBuild/amd64.
+@@ -84,7 +85,9 @@ def get_python_inc(plat_specific=0, prefix=None):
+ If 'prefix' is supplied, use it instead of sys.base_prefix or
+ sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
+ """
+- if prefix is None:
++ if prefix is None and os.environ['STAGING_INCDIR'] != "":
++ prefix = os.environ['STAGING_INCDIR'].rstrip('include')
++ elif prefix is None:
+ prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
+ if os.name == "posix":
+ if python_build:
+@@ -125,6 +128,10 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+ If 'prefix' is supplied, use it instead of sys.base_prefix or
+ sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
+ """
++ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
++ if prefix is None and os.environ['STAGING_LIBDIR'] != "":
++ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
++
+ if prefix is None:
+ if standard_lib:
+ prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
+@@ -133,7 +140,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+
+ if os.name == "posix":
+ libpython = os.path.join(prefix,
+- "lib", "python" + get_python_version())
++ lib_basename, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+@@ -233,7 +240,7 @@ def get_config_h_filename():
+ else:
+ inc_dir = get_python_inc(plat_specific=1)
+
+- return os.path.join(inc_dir, 'pyconfig.h')
++ return os.path.join(inc_dir, 'pyconfig.h'.replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ))
+
+
+ def get_makefile_filename():
+@@ -242,7 +249,7 @@ def get_makefile_filename():
+ return os.path.join(_sys_home or project_base, "Makefile")
+ lib_dir = get_python_lib(plat_specific=0, standard_lib=1)
+ config_file = 'config-{}{}'.format(get_python_version(), build_flags)
+- return os.path.join(lib_dir, config_file, 'Makefile')
++ return os.path.join(lib_dir, config_file, 'Makefile').replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+
+
+ def parse_config_h(fp, g=None):
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/130-readline-setup.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/130-readline-setup.patch
new file mode 100644
index 000000000..c805652d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/130-readline-setup.patch
@@ -0,0 +1,55 @@
+package python-readline
+
+-Khem
+
+Upstream-Status: Inappropriate [Embedded Specific]
+
+--- a/setup.py
++++ b/setup.py
+@@ -666,45 +666,7 @@ class PyBuildExt(build_ext):
+ # readline
+ do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
+ readline_termcap_library = ""
+- curses_library = ""
+- # Cannot use os.popen here in py3k.
+- tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib')
+- if not os.path.exists(self.build_temp):
+- os.makedirs(self.build_temp)
+- # Determine if readline is already linked against curses or tinfo.
+- if do_readline:
+- if cross_compiling:
+- ret = os.system("%s -d %s | grep '(NEEDED)' > %s" \
+- % (sysconfig.get_config_var('READELF'),
+- do_readline, tmpfile))
+- elif find_executable('ldd'):
+- ret = os.system("ldd %s > %s" % (do_readline, tmpfile))
+- else:
+- ret = 256
+- if ret >> 8 == 0:
+- with open(tmpfile) as fp:
+- for ln in fp:
+- if 'curses' in ln:
+- readline_termcap_library = re.sub(
+- r'.*lib(n?cursesw?)\.so.*', r'\1', ln
+- ).rstrip()
+- break
+- # termcap interface split out from ncurses
+- if 'tinfo' in ln:
+- readline_termcap_library = 'tinfo'
+- break
+- if os.path.exists(tmpfile):
+- os.unlink(tmpfile)
+- # Issue 7384: If readline is already linked against curses,
+- # use the same library for the readline and curses modules.
+- if 'curses' in readline_termcap_library:
+- curses_library = readline_termcap_library
+- elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
+- curses_library = 'ncursesw'
+- elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
+- curses_library = 'ncurses'
+- elif self.compiler.find_library_file(lib_dirs, 'curses'):
+- curses_library = 'curses'
++ curses_library = "ncurses"
+
+ if host_platform == 'darwin':
+ os_release = int(os.uname()[2].split('.')[0])
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch
new file mode 100644
index 000000000..78d7c7867
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch
@@ -0,0 +1,17 @@
+Fix warning with newer compiler
+
+-Khem
+
+Upstream-Status: Pending
+
+--- a/Modules/_cursesmodule.c
++++ b/Modules/_cursesmodule.c
+@@ -116,7 +116,7 @@ char *PyCursesVersion = "2.2";
+ #defines many common symbols (such as "lines") which breaks the
+ curses module in other ways. So the code will just specify
+ explicit prototypes here. */
+-extern int setupterm(char *,int,int *);
++//extern int setupterm(char *,int,int *);
+ #ifdef __sgi
+ #include <term.h>
+ #endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch
new file mode 100644
index 000000000..f29ae5337
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Pending
+
+We should make sure that sysroot is used by gcc instead of assuming
+hardcoded locations for include paths
+
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: Python-3.4.2/configure.ac
+===================================================================
+--- Python-3.4.2.orig/configure.ac
++++ Python-3.4.2/configure.ac
+@@ -4434,7 +4434,7 @@ fi
+
+ # first curses header check
+ ac_save_cppflags="$CPPFLAGS"
+-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
++CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw"
+
+ AC_CHECK_HEADERS(curses.h ncurses.h)
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
new file mode 100644
index 000000000..3347321fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
@@ -0,0 +1,39 @@
+_tkinter module needs tk module along with tcl. tk is not yet integrated
+in yocto so we skip the check for this module.
+Avoid a warning by not adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Also simply disable the tk module since its not in DEPENDS.
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2012-04-05 23:18:38.500136647 +0300
++++ Python-2.7.2/setup.py 2012-04-05 23:19:35.888134969 +0300
+@@ -1634,8 +1634,10 @@
+ # Call the method for detecting whether _tkinter can be compiled
+ self.detect_tkinter(inc_dirs, lib_dirs)
+
+- if '_tkinter' not in [e.name for e in self.extensions]:
+- missing.append('_tkinter')
++ # tkinter module will not be avalaible as yocto
++ # doesn't have tk integrated (yet)
++ #if '_tkinter' not in [e.name for e in self.extensions]:
++ # missing.append('_tkinter')
+
+ return missing
+
+diff --git Python-3.5.1.orig/setup.py Python-3.5.1/setup.py
+index b4633b9..d7588c0 100644
+--- Python-3.5.1.orig/setup.py
++++ Python-3.5.1/setup.py
+@@ -1536,7 +1536,7 @@ class PyBuildExt(build_ext):
+ self.extensions.extend(exts)
+
+ # Call the method for detecting whether _tkinter can be compiled
+- self.detect_tkinter(inc_dirs, lib_dirs)
++ # self.detect_tkinter(inc_dirs, lib_dirs)
+
+ # tkinter module will not be avalaible as yocto
+ # doesn't have tk integrated (yet)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/cgi_py.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/cgi_py.patch
new file mode 100644
index 000000000..de504f9dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/cgi_py.patch
@@ -0,0 +1,23 @@
+Lib/cgi.py: Update the script as mentioned in the comment
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- Python-2.6.6/Lib/cgi.py.orig 2010-08-01 22:14:27.000000000 -0500
++++ Python-2.6.6/Lib/cgi.py 2011-09-21 15:28:40.478208631 -0500
+@@ -1,13 +1,4 @@
+-#! /usr/local/bin/python
+-
+-# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
+-# intentionally NOT "/usr/bin/env python". On many systems
+-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
+-# scripts, and /usr/local/bin is the default directory where Python is
+-# installed, so /usr/bin/env would be unable to find python. Granted,
+-# binary installations by Linux vendors often install Python in
+-# /usr/bin. So let those vendors patch cgi.py to match their choice
+-# of installation.
++#! /usr/bin/env python
+
+ """Support module for CGI (Common Gateway Interface) scripts.
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch
new file mode 100644
index 000000000..97214f9aa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch
@@ -0,0 +1,30 @@
+From 7c4f8d87473d6238c120ec6031b58f83a17a39a5 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 28 Dec 2015 22:52:06 -0800
+Subject: [PATCH] configure.ac: fix LIBPL
+
+Use LIBDIR rather than prefix/lib, so that it would work when lib64.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 63aef8e..aefb27f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4366,7 +4366,7 @@ AC_MSG_RESULT($LDVERSION)
+
+ dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
+ AC_SUBST(PY_ENABLE_SHARED)
+-LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
++LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}"
+ AC_SUBST(LIBPL)
+
+ # Check whether right shifting a negative integer extends the sign bit
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch
new file mode 100644
index 000000000..cd1a978eb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Inappropriate [Embedded specific]
+
+This patch fixes issuing with different libdir like lib64.
+This patch makes the native python binary modules findable
+in the install process of the host python.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/03/14
+
+Updated for python 2.7.3
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/05/01
+
+Index: Python-3.3.0rc2/Lib/sysconfig.py
+===================================================================
+--- Python-3.3.0rc2.orig/Lib/sysconfig.py 2012-09-20 22:50:11.000000000 -0700
++++ Python-3.3.0rc2/Lib/sysconfig.py 2012-09-20 22:53:01.561123396 -0700
+@@ -21,9 +21,9 @@
+
+ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+- 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}',
++ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
++ 'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include':
+ '{installed_base}/include/python{py_version_short}{abiflags}',
+@@ -83,7 +83,7 @@
+ 'posix_user': {
+ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
++ 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+Index: Python-3.3.0rc2/Makefile.pre.in
+===================================================================
+--- Python-3.3.0rc2.orig/Makefile.pre.in 2012-09-20 22:50:11.000000000 -0700
++++ Python-3.3.0rc2/Makefile.pre.in 2012-09-20 22:50:54.245123997 -0700
+@@ -1080,9 +1080,9 @@
+ $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/host_include_contamination.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/host_include_contamination.patch
new file mode 100644
index 000000000..ef2054d9a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/host_include_contamination.patch
@@ -0,0 +1,28 @@
+when building python for qemux86-64 on ubuntu 11.10/64bit
+it gropes into host includes and then mixes them with cross
+includes and as a result some modules fail to compile and link
+one of the modules is python-elementtree which is then not
+found during image creation
+
+Proble is that setup.py tries to add native includes that newer
+ubuntu has introduced for multiarch support. But that should
+only happen for native builds and not cross building python
+so we add a check here.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: Python-3.3.0rc2/setup.py
+===================================================================
+--- Python-3.3.0rc2.orig/setup.py 2012-09-20 21:54:50.000000000 -0700
++++ Python-3.3.0rc2/setup.py 2012-09-20 21:57:35.029123858 -0700
+@@ -402,6 +402,9 @@
+
+ if not find_executable('dpkg-architecture'):
+ return
++ if cross_compiling:
++ return
++
+ opt = ''
+ if cross_compiling:
+ opt = '-t' + sysconfig.get_config_var('HOST_GNU_TYPE')
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
new file mode 100644
index 000000000..44ec424cd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
@@ -0,0 +1,312 @@
+Upstream-Status: Pending
+
+get the sys.lib from python itself and do not use hardcoded value of 'lib'
+
+02/2015 Rebased for 3.4.2
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-3.5.0/Include/pythonrun.h
+===================================================================
+--- Python-3.5.0.orig/Include/pythonrun.h
++++ Python-3.5.0/Include/pythonrun.h
+@@ -23,6 +23,9 @@ typedef struct {
+ } PyCompilerFlags;
+ #endif
+
++PyAPI_FUNC(const char *) Py_GetArch(void);
++PyAPI_FUNC(const char *) Py_GetLib(void);
++
+ #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.0/Lib/distutils/command/install.py
+===================================================================
+--- Python-3.5.0.orig/Lib/distutils/command/install.py
++++ Python-3.5.0/Lib/distutils/command/install.py
+@@ -19,6 +19,8 @@ from site import USER_BASE
+ from site import USER_SITE
+ HAS_USER_SITE = True
+
++libname = sys.lib
++
+ WINDOWS_SCHEME = {
+ 'purelib': '$base/Lib/site-packages',
+ 'platlib': '$base/Lib/site-packages',
+@@ -30,7 +32,7 @@ WINDOWS_SCHEME = {
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+ 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
++ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+Index: Python-3.5.0/Lib/pydoc.py
+===================================================================
+--- Python-3.5.0.orig/Lib/pydoc.py
++++ Python-3.5.0/Lib/pydoc.py
+@@ -393,7 +393,7 @@ class Doc:
+
+ docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS)
+
+- basedir = os.path.join(sys.base_exec_prefix, "lib",
++ basedir = os.path.join(sys.base_exec_prefix, sys.lib,
+ "python%d.%d" % sys.version_info[:2])
+ if (isinstance(object, type(os)) and
+ (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
+Index: Python-3.5.0/Lib/trace.py
+===================================================================
+--- Python-3.5.0.orig/Lib/trace.py
++++ Python-3.5.0/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)
+Index: Python-3.5.0/Makefile.pre.in
+===================================================================
+--- Python-3.5.0.orig/Makefile.pre.in
++++ Python-3.5.0/Makefile.pre.in
+@@ -101,6 +101,8 @@ PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS
+
+ # Machine-dependent subdirectories
+ MACHDEP= @MACHDEP@
++LIB= @LIB@
++ARCH= @ARCH@
+
+ # Multiarch directory (may be empty)
+ MULTIARCH= @MULTIARCH@
+@@ -120,7 +122,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= @libdir@
+ ABIFLAGS= @ABIFLAGS@
+
+ # Detailed destination directories
+@@ -729,6 +731,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
+@@ -798,7 +801,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.0/Modules/getpath.c
+===================================================================
+--- Python-3.5.0.orig/Modules/getpath.c
++++ Python-3.5.0/Modules/getpath.c
+@@ -117,9 +117,11 @@
+ #define EXEC_PREFIX PREFIX
+ #endif
+
++#define LIB_PYTHON LIB "/python" VERSION
++
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
+ #endif
+
+ #ifndef LANDMARK
+@@ -130,6 +132,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.0/Python/getplatform.c
+===================================================================
+--- Python-3.5.0.orig/Python/getplatform.c
++++ Python-3.5.0/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.0/Python/sysmodule.c
+===================================================================
+--- Python-3.5.0.orig/Python/sysmodule.c
++++ Python-3.5.0/Python/sysmodule.c
+@@ -1767,6 +1767,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.0/setup.py
+===================================================================
+--- Python-3.5.0.orig/setup.py
++++ Python-3.5.0/setup.py
+@@ -472,7 +472,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:
+@@ -530,8 +530,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:
+@@ -716,11 +715,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.0/Lib/sysconfig.py
+===================================================================
+--- Python-3.5.0.orig/Lib/sysconfig.py
++++ Python-3.5.0/Lib/sysconfig.py
+@@ -20,10 +20,10 @@ __all__ = [
+
+ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+- 'stdlib': '{installed_base}/lib/python{py_version_short}',
+- 'platstdlib': '{platbase}/lib/python{py_version_short}',
++ 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}',
++ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+ 'purelib': '{base}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
++ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include':
+ '{installed_base}/include/python{py_version_short}{abiflags}',
+ 'platinclude':
+@@ -32,10 +32,10 @@ _INSTALL_SCHEMES = {
+ 'data': '{base}',
+ },
+ 'posix_home': {
+- 'stdlib': '{installed_base}/lib/python',
+- 'platstdlib': '{base}/lib/python',
++ 'stdlib': '{installed_base}/'+sys.lib+'/python',
++ 'platstdlib': '{base}/'+sys.lib+'/python',
+ 'purelib': '{base}/lib/python',
+- 'platlib': '{base}/lib/python',
++ 'platlib': '{base}/'+sys.lib+'/python',
+ 'include': '{installed_base}/include/python',
+ 'platinclude': '{installed_base}/include/python',
+ 'scripts': '{base}/bin',
+@@ -61,10 +61,10 @@ _INSTALL_SCHEMES = {
+ 'data': '{userbase}',
+ },
+ 'posix_user': {
+- 'stdlib': '{userbase}/lib/python{py_version_short}',
+- 'platstdlib': '{userbase}/lib/python{py_version_short}',
++ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
++ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+ 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
++ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+ 'data': '{userbase}',
+Index: Python-3.5.0/configure.ac
+===================================================================
+--- Python-3.5.0.orig/configure.ac
++++ Python-3.5.0/configure.ac
+@@ -858,6 +858,41 @@ PLATDIR=plat-$MACHDEP
+ AC_SUBST(PLATDIR)
+ AC_SUBST(PLATFORM_TRIPLET)
+
++AC_SUBST(ARCH)
++AC_MSG_CHECKING(ARCH)
++ARCH=`uname -m`
++case $ARCH in
++i?86) ARCH=i386;;
++esac
++AC_MSG_RESULT($ARCH)
++
++AC_SUBST(LIB)
++AC_MSG_CHECKING(LIB)
++case $ac_sys_system in
++Linux*)
++ # Test if the compiler is 64bit
++ echo 'int i;' > conftest.$ac_ext
++ python_cv_cc_64bit_output=no
++ if AC_TRY_EVAL(ac_compile); then
++ case `/usr/bin/file conftest.$ac_objext` in
++ *"ELF 64"*)
++ python_cv_cc_64bit_output=yes
++ ;;
++ esac
++ fi
++ rm -rf conftest*
++ ;;
++esac
++
++case $ARCH:$python_cv_cc_64bit_output in
++ppc64:yes | powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
++ LIB="lib64"
++ ;;
++*:*)
++ LIB="lib"
++ ;;
++esac
++AC_MSG_RESULT($LIB)
+
+ AC_MSG_CHECKING([for -Wl,--no-as-needed])
+ save_LDFLAGS="$LDFLAGS"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-config.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-config.patch
new file mode 100644
index 000000000..f23b8b7df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python-config.patch
@@ -0,0 +1,46 @@
+python-config: Revert to using distutils.sysconfig
+
+The newer sysconfig module shares some code with distutils.sysconfig, but the same modifications as in
+
+12-distutils-prefix-is-inside-staging-area.patch makes distutils.sysconfig
+
+affect the native runtime as well as cross building. Use the old, patched
+implementation which returns paths in the staging directory and for the target,
+as appropriate.
+
+Upstream-Status: Inappropriate [Embedded Specific]
+
+Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
+:
+Index: Python-3.3.3/Misc/python-config.in
+===================================================================
+--- Python-3.3.3.orig/Misc/python-config.in
++++ Python-3.3.3/Misc/python-config.in
+@@ -4,7 +4,7 @@
+ import getopt
+ import os
+ import sys
+-import sysconfig
++from distutils import sysconfig
+
+ valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
+ 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir']
+@@ -32,14 +32,14 @@ if '--help' in opt_flags:
+
+ for opt in opt_flags:
+ if opt == '--prefix':
+- print(sysconfig.get_config_var('prefix'))
++ print(sysconfig.PREFIX)
+
+ elif opt == '--exec-prefix':
+- print(sysconfig.get_config_var('exec_prefix'))
++ print(sysconfig.EXEC_PREFIX)
+
+ elif opt in ('--includes', '--cflags'):
+- flags = ['-I' + sysconfig.get_path('include'),
+- '-I' + sysconfig.get_path('platinclude')]
++ flags = ['-I' + sysconfig.get_python_inc(),
++ '-I' + sysconfig.get_python_inc(plat_specific=True)]
+ if opt == '--cflags':
+ flags.extend(getvar('CFLAGS').split())
+ print(' '.join(flags))
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch
new file mode 100644
index 000000000..2bc8b8c46
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch
@@ -0,0 +1,33 @@
+From 43238e1ac13e32984d015c92a5841f3de1fe1d15 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Tue, 18 Nov 2014 00:07:07 -0500
+Subject: [PATCH] setup.py: no host headers libs
+
+When we are cross-compiling, setup.py should never look in /usr
+or /usr/local to find headers or libraries.
+
+Upstream-Status: Inappropriate [Cross compile specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ setup.py | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index f020b28..e8339cd 100644
+--- a/setup.py
++++ b/setup.py
+@@ -444,10 +444,7 @@ class PyBuildExt(build_ext):
+ if not cross_compiling:
+ 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:
+ self.add_gcc_paths()
+- if not cross_compiling:
+ self.add_multiarch_paths()
+
+ # Add paths specified in the environment variables LDFLAGS and
+--
+2.0.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
new file mode 100644
index 000000000..74490d93a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
@@ -0,0 +1,28 @@
+From 53ed216d7bf70dd2a925432b6805a701e5fc3e0e Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 17 Nov 2014 06:44:47 +0000
+Subject: [PATCH] python3 use CROSSPYTHONPATH for PYTHON_FOR_BUILD
+
+Upstream-Status: Inappropriate [Cross compile specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 989baf9..2890c96 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -67,7 +67,7 @@ if test "$cross_compiling" = yes; then
+ AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
+ fi
+ AC_MSG_RESULT($interp)
+- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
++ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH) '$interp
+ fi
+ elif test "$cross_compiling" = maybe; then
+ AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
+--
+2.0.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch
new file mode 100644
index 000000000..fc2e12dfe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch
@@ -0,0 +1,50 @@
+From 8dad810f3a3d073f09ad72e1a3ee0a895eab2ca1 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 18 Jan 2015 19:05:36 -0800
+Subject: [PATCH] setup.py:check cross_compiling when get FLAGS
+
+Fixed when compile target pythnon3:
+gcc -isystem/path/to/sysroots/x86_64-linux/usr/include \
+ -L=/path/to/sysroots/x86_64-linux/usr/lib
+
+This is incorrect, the native sysroot should not be used by target
+python3.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ setup.py | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index e8339cd..83fd31f 100644
+--- a/setup.py
++++ b/setup.py
+@@ -238,7 +238,10 @@ class PyBuildExt(build_ext):
+ # unfortunately, distutils doesn't let us provide separate C and C++
+ # compilers
+ if compiler is not None:
+- (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
++ if cross_compiling:
++ (ccshared,cflags) = (os.environ.get('CCSHARED') or '', os.environ.get('CFLAGS') or '')
++ else:
++ (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
+ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
+ self.compiler.set_executables(**args)
+
+@@ -457,7 +460,10 @@ class PyBuildExt(build_ext):
+ ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
+ ('LDFLAGS', '-L', self.compiler.library_dirs),
+ ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+- env_val = sysconfig.get_config_var(env_var)
++ if cross_compiling:
++ env_val = os.environ.get(env_var)
++ else:
++ env_val = sysconfig.get_config_var(env_var)
+ if env_val:
+ # To prevent optparse from raising an exception about any
+ # options in env_val that it doesn't know about we strip out
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch
new file mode 100644
index 000000000..f26bd38b0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch
@@ -0,0 +1,30 @@
+Patch setup.py so that the detect_modules() function looks for required
+libraries and headers in STAGING_LIBDIR / STAGING_INCDIR.
+
+Without this patch, several extension modules are not built, even though
+their dependencies are present in the compiler's search paths.
+The result is the following warning, and ultimately incomplete packages:
+
+| The necessary bits to build these optional modules were not found:
+| _bz2 _curses_panel _dbm
+| _gdbm _lzma _sqlite3
+| nis readline zlib
+| To find the necessary bits, look in setup.py in detect_modules() for the module's name.
+
+Upstream-Status: Inappropriate [Cross compile specific]
+
+Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
+
+Index: Python-3.4.3/setup.py
+===================================================================
+--- Python-3.4.3.orig/setup.py
++++ Python-3.4.3/setup.py
+@@ -521,6 +521,8 @@ class PyBuildExt(build_ext):
+ else:
+ lib_dirs = self.compiler.library_dirs[:]
+ inc_dirs = self.compiler.include_dirs[:]
++ lib_dirs.append(os.environ.get('STAGING_LIBDIR'))
++ inc_dirs.append(os.environ.get('STAGING_INCDIR'))
+ exts = []
+ missing = []
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setuptweaks.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setuptweaks.patch
new file mode 100644
index 000000000..3a91b1916
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/setuptweaks.patch
@@ -0,0 +1,57 @@
+This patch removes various ways native system options can pass into the python
+compilation and somehow break C modules.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2012/04/23
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2012-04-23 20:03:47.295582553 +0000
++++ Python-2.7.2/setup.py 2012-04-23 20:03:15.000000000 +0000
+@@ -231,7 +231,13 @@
+ # compilers
+ if compiler is not None:
+ (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
+- args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
++ # Need to filter out -isysroot from the flags. Ideally should
++ # figure out target flags here.
++ flags = []
++ for f in cflags.split():
++ if not f.startswith("-isystem"):
++ flags.append(f)
++ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + ' '.join(flags)
+ self.compiler.set_executables(**args)
+
+ build_ext.build_extensions(self)
+@@ -393,7 +399,6 @@
+ # into configure and stored in the Makefile (issue found on OS X 10.3).
+ for env_var, arg_name, dir_list in (
+ ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
+- ('LDFLAGS', '-L', self.compiler.library_dirs),
+ ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+ env_val = sysconfig.get_config_var(env_var)
+ if env_val:
+@@ -419,16 +424,16 @@
+ for directory in reversed(options.dirs):
+ add_dir_to_list(dir_list, directory)
+
+- if os.path.normpath(sys.prefix) != '/usr' \
+- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++# if os.path.normpath(sys.prefix) != '/usr' \
++# and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+ # building a framework with different architectures than
+ # the one that is currently installed (issue #7473)
+- add_dir_to_list(self.compiler.library_dirs,
+- sysconfig.get_config_var("LIBDIR"))
+- add_dir_to_list(self.compiler.include_dirs,
+- sysconfig.get_config_var("INCLUDEDIR"))
++# add_dir_to_list(self.compiler.library_dirs,
++# sysconfig.get_config_var("LIBDIR"))
++# add_dir_to_list(self.compiler.include_dirs,
++# sysconfig.get_config_var("INCLUDEDIR"))
+
+ try:
+ have_unicode = unicode
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch
new file mode 100644
index 000000000..802b1c720
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch
@@ -0,0 +1,17 @@
+shutils should consider symlinks
+
+-Khem
+
+Upstream-Status: Pending
+
+--- a/Lib/shutil.py 2013-01-29 12:31:06.926555779 -0800
++++ b/Lib/shutil.py 2013-01-29 16:31:39.097554182 -0800
+@@ -132,7 +132,7 @@ def copymode(src, dst, *, follow_symlink
+ st = stat_func(src)
+ chmod_func(dst, stat.S_IMODE(st.st_mode))
+
+-if hasattr(os, 'listxattr'):
++if hasattr(os, 'listxattr') and os.listxattr in os.supports_follow_symlinks:
+ def _copyxattr(src, dst, *, follow_symlinks=True):
+ """Copy extended filesystem attributes from `src` to `dst`.
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sitecustomize.py b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sitecustomize.py
new file mode 100644
index 000000000..4c8b5e2ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sitecustomize.py
@@ -0,0 +1,37 @@
+# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# GPLv2 or later
+# Version: 20081123
+# Features:
+# * set proper default encoding
+# * enable readline completion in the interactive interpreter
+# * load command line history on startup
+# * save command line history on exit
+
+import os
+
+def __exithandler():
+ try:
+ readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+def __registerExitHandler():
+ import atexit
+ atexit.register( __exithandler )
+
+def __enableReadlineSupport():
+ readline.set_history_length( 1000 )
+ readline.parse_and_bind( "tab: complete" )
+ try:
+ readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+import sys
+try:
+ import rlcompleter, readline
+except ImportError:
+ pass
+else:
+ __registerExitHandler()
+ __enableReadlineSupport()
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch
new file mode 100644
index 000000000..de07643f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch
@@ -0,0 +1,54 @@
+From fc93b3cc23b4f9698ae92a42986dbb02b6f19588 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 18 Jan 2015 06:29:50 -0800
+Subject: [PATCH] sysconfig.py: add _PYTHON_PROJECT_SRC
+
+python3 has introduced _PYTHON_PROJECT_BASE which is used for separate B
+and S, but it doesn't work when compile Modules, the target python3 runs
+python3-native's sysconfig to get srcdir which is the native's, there
+would be errors when native's srcdir has been removed, add
+_PYTHON_PROJECT_SRC to fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Lib/distutils/sysconfig.py | 5 ++++-
+ Lib/sysconfig.py | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index a545ab9..74317d1 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -554,7 +554,10 @@ def get_config_vars(*args):
+ _config_vars['exec_prefix'] = EXEC_PREFIX
+
+ # Always convert srcdir to an absolute path
+- srcdir = _config_vars.get('srcdir', project_base)
++ if "_PYTHON_PROJECT_SRC" in os.environ:
++ srcdir = os.path.abspath(os.environ["_PYTHON_PROJECT_SRC"])
++ else:
++ srcdir = _config_vars.get('srcdir', project_base)
+ if os.name == 'posix':
+ if python_build:
+ # If srcdir is a relative path (typically '.' or '..')
+diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
+index 7287f11..cc92998 100644
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -562,7 +562,10 @@ def get_config_vars(*args):
+ _CONFIG_VARS['userbase'] = _getuserbase()
+
+ # Always convert srcdir to an absolute path
+- srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
++ if "_PYTHON_PROJECT_SRC" in os.environ:
++ srcdir = os.path.abspath(os.environ["_PYTHON_PROJECT_SRC"])
++ else:
++ srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
+ if os.name == 'posix':
+ if _PYTHON_BUILD:
+ # If srcdir is a relative path (typically '.' or '..')
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch
new file mode 100644
index 000000000..785b5567f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch
@@ -0,0 +1,35 @@
+Dont search hardcoded paths, we might be doing a cross-build
+Use '=' in-front to let compiler append sysroot, if it can
+
+Should fix things like
+
+configure:6972: arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 -DNDEBUG -fno-inline -D__SOFTFP__ --sysroot=/build/v2013.06/build/tmp-angstrom_v2013_06-eglibc/sysroots/beaglebone -c -O2 -pipe -g -feliminate-unused-debug-types -I/usr/include/ncursesw conftest.c >&5
+cc1: warning: include location "/usr/include/ncursesw" is unsafe for cross-compilation [-Wpoison-system-directories]
+
+
+Signed-off-by: Khem Raj
+Upstream-Status: Pending
+
+
+Index: Python-3.3.2/setup.py
+===================================================================
+--- Python-3.3.2.orig/setup.py 2013-07-30 01:30:48.000000000 -0700
++++ Python-3.3.2/setup.py 2013-07-30 01:41:11.697862723 -0700
+@@ -1210,7 +1210,7 @@
+ panel_library = 'panel'
+ if curses_library == 'ncursesw':
+ curses_defines.append(('HAVE_NCURSESW', '1'))
+- curses_includes.append('/usr/include/ncursesw')
++ curses_includes.append('=/usr/include/ncursesw')
+ # Bug 1464056: If _curses.so links with ncursesw,
+ # _curses_panel.so must link with panelw.
+ panel_library = 'panelw'
+@@ -1819,7 +1819,7 @@
+ if host_platform == 'darwin':
+ # OS X 10.5 comes with libffi.dylib; the include files are
+ # in /usr/include/ffi
+- inc_dirs.append('/usr/include/ffi')
++ inc_dirs.append('=/usr/include/ffi')
+
+ ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
+ if not ffi_inc or ffi_inc[0] == '':
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch
new file mode 100644
index 000000000..8d037278b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch
@@ -0,0 +1,52 @@
+From 5d6509313198ec9b686cad50b002212e4344004b Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 11 Mar 2016 01:15:45 -0500
+Subject: [PATCH] configure.ac: tweak MULTIARCH for powerpc-linux-gnuspe
+
+For p1022ds bsp, the MULTIARCH is powerpc-linux-gnuspev1 and
+python3 did not recognize the extra 'v1' which caused python3
+configure error for the platform triplet.
+
+Q:Why Python3 check platform triplet?
+
+A:Under Linux, GNU/KFreeBSD and the Hurd, C extensions now include
+the architecture triplet in the extension name, to make it easy to
+test builds for different ABIs in the same working tree.
+
+Here is the generated C extensions which take platform triplet into account.
+...
+|image/usr/lib/python3.5/lib-dynload/_datetime.cpython-35m-powerpc-linux-gnuspe.so
+...
+
+https://bugs.python.org/issue22980
+https://www.python.org/dev/peps/pep-3149/
+https://bugs.python.org/review/22980/patch/14593/54808
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 9eb3d22..c34a9a0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -724,6 +724,13 @@ fi
+
+
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
++
++# Tweak MULTIARCH
++if test x$MULTIARCH = xpowerpc-linux-gnuspev1
++then
++ MULTIARCH="powerpc-linux-gnuspe"
++fi
++
+ AC_SUBST(MULTIARCH)
+
+ AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3/unixccompiler.patch b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/unixccompiler.patch
new file mode 100644
index 000000000..7b90f1388
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/unixccompiler.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information.
+This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name.
+
+Secondly add -L=<path> this way linker will be able to resolve /usr/lib w.r.t sysroot and not
+use hardcoded /usr/lib to look for libs which is wrong in cross compile environment and this will work
+ok on native systems too since sysroot for native compilers is /
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: Python-3.3.2/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-3.3.2.orig/Lib/distutils/unixccompiler.py 2013-05-15 09:32:54.000000000 -0700
++++ Python-3.3.2/Lib/distutils/unixccompiler.py 2013-08-01 00:58:18.629056286 -0700
+@@ -202,7 +202,9 @@
+ # ccompiler.py.
+
+ def library_dir_option(self, dir):
+- return "-L" + dir
++ if dir.startswith("."):
++ return "-L" + dir
++ return "-L=" + dir
+
+ def _is_gcc(self, compiler_name):
+ return "gcc" in compiler_name or "g++" in compiler_name
+@@ -221,7 +221,7 @@
+ # this time, there's no way to determine this information from
+ # the configuration data stored in the Python installation, so
+ # we use this hack.
+- compiler = os.path.basename(sysconfig.get_config_var("CC"))
++ compiler = sysconfig.get_config_var("CC")
+ if sys.platform[:6] == "darwin":
+ # MacOSX's linker doesn't understand the -R flag at all
+ return "-L" + dir
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
new file mode 100644
index 000000000..6c4b0cda9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3/use_packed_importlib.patch
@@ -0,0 +1,31 @@
+
+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.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3_3.5.1.bb
new file mode 100644
index 000000000..2fbb3cbc3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3_3.5.1.bb
@@ -0,0 +1,226 @@
+require recipes-devtools/python/python.inc
+
+DEPENDS = "python3-native libffi bzip2 db gdbm openssl readline sqlite3 zlib virtual/libintl xz"
+PR = "${INC_PR}.0"
+PYTHON_MAJMIN = "3.5"
+PYTHON_BINABI= "${PYTHON_MAJMIN}m"
+DISTRO_SRC_URI ?= "file://sitecustomize.py"
+DISTRO_SRC_URI_linuxstdbase = ""
+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 \
+file://110-enable-zlib.patch \
+file://130-readline-setup.patch \
+file://150-fix-setupterm.patch \
+file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
+file://tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch \
+${DISTRO_SRC_URI} \
+"
+
+SRC_URI += "\
+ file://03-fix-tkinter-detection.patch \
+ file://avoid_warning_about_tkinter.patch \
+ file://cgi_py.patch \
+ file://host_include_contamination.patch \
+ file://python-3.3-multilib.patch \
+ file://shutil-follow-symlink-fix.patch \
+ file://sysroot-include-headers.patch \
+ file://unixccompiler.patch \
+ file://avoid-ncursesw-include-path.patch \
+ file://python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \
+ file://python3-setup.py-no-host-headers-libs.patch \
+ file://sysconfig.py-add-_PYTHON_PROJECT_SRC.patch \
+ file://setup.py-check-cross_compiling-when-get-FLAGS.patch \
+ file://setup.py-find-libraries-in-staging-dirs.patch \
+ file://use_packed_importlib.patch \
+ file://configure.ac-fix-LIBPL.patch \
+ "
+SRC_URI[md5sum] = "e9ea6f2623fffcdd871b7b19113fde80"
+SRC_URI[sha256sum] = "c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9"
+
+# exclude pre-releases for both python 2.x and 3.x
+UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=dd98d01d471fac8d8dbdd975229dba03"
+
+S = "${WORKDIR}/Python-${PV}"
+
+inherit autotools multilib_header python3native pkgconfig
+
+CONFIGUREOPTS += " --with-system-ffi "
+
+CACHED_CONFIGUREVARS = "ac_cv_have_chflags=no \
+ ac_cv_have_lchflags=no \
+ ac_cv_have_long_long_format=yes \
+ ac_cv_buggy_getaddrinfo=no \
+ ac_cv_file__dev_ptmx=yes \
+ ac_cv_file__dev_ptc=no \
+"
+
+TARGET_CC_ARCH += "-DNDEBUG -fno-inline"
+SDK_CC_ARCH += "-DNDEBUG -fno-inline"
+EXTRA_OEMAKE += "CROSS_COMPILE=yes"
+EXTRA_OECONF += "CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ --without-ensurepip"
+
+export CROSS_COMPILE = "${TARGET_PREFIX}"
+export _PYTHON_PROJECT_BASE = "${B}"
+export _PYTHON_PROJECT_SRC = "${S}"
+export CCSHARED = "-fPIC"
+
+# Fix ctypes cross compilation
+export CROSSPYTHONPATH = "${B}/build/lib.linux-${TARGET_ARCH}-${PYTHON_MAJMIN}:${S}/Lib:${S}/Lib/plat-linux"
+
+# No ctypes option for python 3
+PYTHONLSBOPTS = ""
+
+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-linux*
+ include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ ${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,^CONFIGURE_LDFLAGS=.*,CONFIGURE_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
+
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+ OPT="${CFLAGS}" libpython3.so
+
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+ 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
+
+ install -d ${D}${libdir}/pkgconfig
+ install -d ${D}${libdir}/python${PYTHON_MAJMIN}/config
+
+ # rerun the build once again with original makefile this time
+ # run install in a separate step to avoid compile/install race
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+ DESTDIR=${D} LIBDIR=${libdir}
+
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+ DESTDIR=${D} LIBDIR=${libdir} install
+
+ # avoid conflict with 2to3 from Python 2
+ rm -f ${D}/${bindir}/2to3
+
+ 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_BINABI}/pyconfig.h
+}
+
+do_install_append_class-nativesdk () {
+ create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} 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
+}
+
+require python-${PYTHON_MAJMIN}-manifest.inc
+
+# manual dependency additions
+RPROVIDES_${PN}-core = "${PN}"
+RRECOMMENDS_${PN}-core = "${PN}-readline"
+RRECOMMENDS_${PN}-crypt = "openssl"
+RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl"
+
+FILES_${PN}-2to3 += "${bindir}/2to3-${PYTHON_MAJMIN}"
+FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
+FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
+
+PACKAGES =+ "${PN}-pyvenv"
+FILES_${PN}-pyvenv += "${bindir}/pyvenv-${PYTHON_MAJMIN} ${bindir}/pyvenv"
+
+# package libpython3
+PACKAGES =+ "libpython3 libpython3-staticdev"
+FILES_libpython3 = "${libdir}/libpython*.so.*"
+FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/libpython${PYTHON_BINABI}.a"
+INSANE_SKIP_${PN}-dev += "dev-elf"
+
+# catch all the rest (unsorted)
+PACKAGES += "${PN}-misc"
+RDEPENDS_${PN}-misc += "${PN}-core"
+RDEPENDS_${PN}-modules += "${PN}-misc"
+FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
+
+# 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.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python_2.7.11.bb
new file mode 100644
index 000000000..606f15362
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python_2.7.11.bb
@@ -0,0 +1,173 @@
+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://avoid_parallel_make_races_on_pgen.patch \
+ file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ 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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ 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} \
+ BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ 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
+}
+
+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/nativesdk-qemu-helper_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb
new file mode 100644
index 000000000..51d1c5969
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Qemu helper scripts"
+LICENSE = "GPLv2"
+RDEPENDS_${PN} = "nativesdk-qemu"
+PR = "r9"
+
+
+LIC_FILES_CHKSUM = "file://${WORKDIR}/tunctl.c;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999 \
+ file://${COREBASE}/scripts/runqemu;endline=18;md5=77fbe442a88b1bcdc29c3ba67733b21b"
+
+
+SRC_URI = "file://${COREBASE}/scripts/runqemu \
+ file://${COREBASE}/scripts/runqemu-internal \
+ file://${COREBASE}/scripts/runqemu-addptable2image \
+ file://${COREBASE}/scripts/runqemu-gen-tapdevs \
+ file://${COREBASE}/scripts/runqemu-ifup \
+ file://${COREBASE}/scripts/runqemu-ifdown \
+ file://${COREBASE}/scripts/oe-find-native-sysroot \
+ file://${COREBASE}/scripts/runqemu-extract-sdk \
+ file://${COREBASE}/scripts/runqemu-export-rootfs \
+ file://tunctl.c \
+ file://raw2flash.c \
+ "
+
+S = "${WORKDIR}"
+
+inherit nativesdk
+
+do_compile() {
+ ${CC} tunctl.c -o tunctl
+ ${CC} raw2flash.c -o raw2flash.spitz
+ ${CC} raw2flash.c -o flash2raw.spitz -Dflash2raw
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}${COREBASE}/scripts/oe-* ${D}${bindir}/
+ install -m 0755 ${WORKDIR}${COREBASE}/scripts/runqemu* ${D}${bindir}/
+ install tunctl ${D}${bindir}/
+ install raw2flash.spitz ${D}${bindir}/
+ install flash2raw.spitz ${D}${bindir}/
+ ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.akita
+ ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.borzoi
+ ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.terrier
+ ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.akita
+ ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.borzoi
+ ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.terrier
+}
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
new file mode 100644
index 000000000..8d27c4db6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Helper utilities needed by the runqemu script"
+LICENSE = "GPLv2"
+RDEPENDS_${PN} = "qemu-native"
+PR = "r1"
+
+LIC_FILES_CHKSUM = "file://${WORKDIR}/tunctl.c;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999"
+
+SRC_URI = "file://tunctl.c"
+
+S = "${WORKDIR}"
+
+inherit native
+
+do_compile() {
+ ${CC} tunctl.c -o tunctl
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install tunctl ${D}${bindir}/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c
new file mode 100644
index 000000000..19faf629b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c
@@ -0,0 +1,370 @@
+/*
+ * Copyright (c) 2006 OpenedHand Ltd.
+ *
+ * This file is licensed under GNU GPL v2.
+ */
+#include <string.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <stdlib.h>
+
+#define TFR(_) _
+#define VERBOSE
+#define PBAR_LEN 40
+
+#define PARTITION_START 0x00700000
+
+static const int ecc_pos8[] = {
+ 0x0, 0x1, 0x2,
+};
+
+static const int ecc_pos16[] = {
+ 0x0, 0x1, 0x2, 0x3, 0x6, 0x7,
+};
+
+static const int ecc_pos64[] = {
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+};
+
+static const int ecc_akita[] = {
+ 0x05, 0x01, 0x02, 0x03, 0x06, 0x07, 0x15, 0x11,
+ 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
+ 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37,
+};
+
+struct jffs_marker_s {
+ int pos;
+ uint8_t value;
+};
+
+static const struct jffs_marker_s free_pos8[] = {
+ { 0x03, 0xff }, { 0x04, 0xff }, { 0x06, 0x85 }, { 0x07, 0x19 },
+ { -1 },
+};
+
+static const struct jffs_marker_s free_pos16[] = {
+ { 0x08, 0x85 }, { 0x09, 0x19 }, { 0x0a, 0x03 }, { 0x0b, 0x20 },
+ { 0x0c, 0x08 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 },
+ { -1 },
+};
+
+static const struct jffs_marker_s free_pos64[] = {
+ { 0x02, 0xff }, { 0x03, 0xff }, { 0x04, 0xff }, { 0x05, 0xff },
+ { 0x06, 0xff }, { 0x07, 0xff }, { 0x08, 0xff }, { 0x09, 0xff },
+ { 0x0a, 0xff }, { 0x0b, 0xff }, { 0x0c, 0xff }, { 0x0d, 0xff },
+ { 0x0e, 0xff }, { 0x0f, 0xff }, { 0x10, 0x85 }, { 0x11, 0x19 },
+ { 0x12, 0x03 }, { 0x13, 0x20 }, { 0x14, 0x08 }, { 0x15, 0x00 },
+ { 0x16, 0x00 }, { 0x17, 0x00 }, { 0x18, 0xff }, { 0x19, 0xff },
+ { 0x1a, 0xff }, { 0x1b, 0xff }, { 0x1c, 0xff }, { 0x1d, 0xff },
+ { 0x1e, 0xff }, { 0x1f, 0xff }, { 0x20, 0xff }, { 0x21, 0xff },
+ { 0x22, 0xff }, { 0x23, 0xff }, { 0x24, 0xff }, { 0x25, 0xff },
+ { 0x26, 0xff }, { 0x27, 0xff },
+ { -1 },
+};
+
+static const struct jffs_marker_s free_akita[] = {
+ { 0x08, 0x85 }, { 0x09, 0x19 }, { 0x0a, 0x03 }, { 0x0b, 0x20 },
+ { 0x0c, 0x08 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 },
+ { 0x10, 0xff },
+ { -1 },
+};
+
+#define LEN(array) (sizeof(array) / sizeof(*array))
+
+static const struct ecc_style_s {
+ int page_size;
+ int oob_size;
+ int eccbytes;
+ int eccsize;
+ const int *eccpos;
+ int romsize;
+ const struct jffs_marker_s *freepos;
+} spitz = {
+ 0x200, 0x10, 0x100, LEN(ecc_pos16), ecc_pos16, 0x01000000, free_pos16
+}, akita = {
+ 0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita
+}, borzoi = {
+ 0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita
+}, terrier = {
+ 0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita
+};
+
+struct ecc_state_s {
+ int count;
+ uint8_t cp;
+ uint8_t lp[2];
+ const struct ecc_style_s *style;
+};
+
+#ifndef flash2raw
+/*
+ * Pre-calculated 256-way 1 byte column parity. Table borrowed from Linux.
+ */
+static const uint8_t ecc_precalc_table[] = {
+ 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a,
+ 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00,
+ 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f,
+ 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65,
+ 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c,
+ 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66,
+ 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59,
+ 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03,
+ 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33,
+ 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69,
+ 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56,
+ 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c,
+ 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55,
+ 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f,
+ 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30,
+ 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a,
+ 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30,
+ 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a,
+ 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55,
+ 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f,
+ 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56,
+ 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c,
+ 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33,
+ 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69,
+ 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59,
+ 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03,
+ 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c,
+ 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66,
+ 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f,
+ 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65,
+ 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a,
+ 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00,
+};
+
+/* Update ECC parity count */
+static inline uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample) {
+ uint8_t idx = ecc_precalc_table[sample];
+
+ s->cp ^= idx & 0x3f;
+ if (idx & 0x40) {
+ s->lp[0] ^= ~(s->count & 0xff);
+ s->lp[1] ^= s->count & 0xff;
+ }
+ s->count ++;
+
+ return sample;
+}
+
+static void buffer_digest(struct ecc_state_s *ecc,
+ const uint8_t *buf, uint8_t *out) {
+ int i, lp_a[2];
+
+ ecc->lp[0] = 0x00;
+ ecc->lp[1] = 0x00;
+ ecc->cp = 0x00;
+ ecc->count = 0;
+ for (i = 0; i < ecc->style->eccbytes; i ++)
+ ecc_digest(ecc, buf[i]);
+
+# define BSHR(byte, from, to) ((ecc->lp[byte] >> (from - to)) & (1 << to))
+ lp_a[0] =
+ BSHR(0, 4, 0) | BSHR(0, 5, 2) |
+ BSHR(0, 6, 4) | BSHR(0, 7, 6) |
+ BSHR(1, 4, 1) | BSHR(1, 5, 3) |
+ BSHR(1, 6, 5) | BSHR(1, 7, 7);
+
+# define BSHL(byte, from, to) ((ecc->lp[byte] << (to - from)) & (1 << to))
+ lp_a[1] =
+ BSHL(0, 0, 0) | BSHL(0, 1, 2) |
+ BSHL(0, 2, 4) | BSHL(0, 3, 6) |
+ BSHL(1, 0, 1) | BSHL(1, 1, 3) |
+ BSHL(1, 2, 5) | BSHL(1, 3, 7);
+
+ out[0] = ~lp_a[1];
+ out[1] = ~lp_a[0];
+ out[2] = (~ecc->cp << 2) | 0x03;
+}
+
+static void jffs2_format(const struct ecc_state_s *ecc, uint8_t oob[]) {
+ const struct jffs_marker_s *byte;
+ for (byte = ecc->style->freepos; byte->pos >= 0; byte ++)
+ oob[byte->pos] = byte->value;
+}
+
+static void buffer_fill(const struct ecc_state_s *ecc, uint8_t buffer[],
+ int *len, int *partition, int count, uint8_t jffs_buffer[]) {
+ int ret;
+
+ switch (*partition) {
+ case 0:
+ if (count < PARTITION_START) {
+ memcpy(buffer, jffs_buffer + count,
+ ecc->style->eccbytes);
+ *len = ecc->style->eccbytes;
+ break;
+ }
+ *partition = 1;
+ case 1:
+ if (count - PARTITION_START < PARTITION_START) {
+ memcpy(buffer, jffs_buffer + count - PARTITION_START,
+ ecc->style->eccbytes);
+ *len = ecc->style->eccbytes;
+ break;
+ }
+
+ while (*len < ecc->style->eccbytes) {
+ ret = TFR(read(0, buffer + *len, 0x800 - *len));
+ if (ret <= 0)
+ break;
+ *len += ret;
+ }
+
+ if (*len == 0)
+ *partition = 2;
+ else if (*len < ecc->style->eccbytes) {
+ fprintf(stderr, "\nWarning: %i stray bytes\n", *len);
+ memset(buffer + *len, 0xff,
+ ecc->style->eccbytes - *len);
+ *len = ecc->style->eccbytes;
+ break;
+ } else
+ break;
+ case 2:
+ memset(buffer, 0xff, ecc->style->eccbytes);
+ *len = ecc->style->eccbytes;
+ break;
+ }
+}
+
+int main(int argc, char *argv[], char *envp[]) {
+ struct ecc_state_s ecc;
+ uint8_t buffer[0x1000], ecc_payload[0x40], regs[3], *jffs;
+ int ret, len, eccbyte, count, partition;
+
+ /* Check if we're called by "raw2flash.spitz" or similar */
+ len = strlen(argv[0]);
+ if (!strcasecmp(argv[0] + len - 5, "akita"))
+ ecc.style = &akita;
+ else if (!strcasecmp(argv[0] + len - 6, "borzoi"))
+ ecc.style = &borzoi;
+ else if (!strcasecmp(argv[0] + len - 7, "terrier"))
+ ecc.style = &terrier;
+ else
+ ecc.style = &spitz;
+
+# ifdef VERBOSE
+ fprintf(stderr, "[");
+# endif
+
+ /* Skip first 10 bytes */
+ TFR(read(0, buffer, 0x10));
+
+ len = 0;
+ jffs = (uint8_t *) malloc(PARTITION_START);
+ while (len < PARTITION_START) {
+ ret = TFR(read(0, jffs + len, PARTITION_START - len));
+ if (ret <= 0)
+ break;
+ len += ret;
+ }
+
+ /* Convert data from stdin */
+ partition = len = eccbyte = count = 0;
+ memset(ecc_payload, 0xff, ecc.style->oob_size);
+ jffs2_format(&ecc, ecc_payload);
+ while (count < ecc.style->romsize) {
+ buffer_fill(&ecc, buffer, &len, &partition, count, jffs);
+ buffer_digest(&ecc, buffer, regs);
+
+ ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[0];
+ ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[1];
+ ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[2];
+
+ TFR(write(1, buffer, ecc.style->eccbytes));
+ count += ecc.style->eccbytes;
+ len -= ecc.style->eccbytes;
+ memmove(buffer, buffer + ecc.style->eccbytes, len);
+
+ if (eccbyte >= ecc.style->eccsize) {
+ TFR(write(1, ecc_payload, ecc.style->oob_size));
+ eccbyte = 0;
+ memset(ecc_payload, 0xff, ecc.style->oob_size);
+ if (partition < 2)
+ jffs2_format(&ecc, ecc_payload);
+ }
+
+# ifdef VERBOSE
+ if (count * PBAR_LEN / ecc.style->romsize >
+ (count - ecc.style->eccbytes) *
+ PBAR_LEN / ecc.style->romsize)
+ fprintf(stderr, "#");
+# endif
+ }
+
+# ifdef VERBOSE
+ fprintf(stderr, "]\n");
+# endif
+ free(jffs);
+ return 0;
+}
+#else
+int main(int argc, char *argv[], char *envp[]) {
+ struct ecc_state_s ecc;
+ uint8_t buffer[0x1000];
+ int ret, len, count;
+
+ /* Check if we're called by "flash2raw.spitz" or similar */
+ len = strlen(argv[0]);
+ if (!strcasecmp(argv[0] + len - 5, "akita"))
+ ecc.style = &akita;
+ else if (!strcasecmp(argv[0] + len - 6, "borzoi"))
+ ecc.style = &borzoi;
+ else if (!strcasecmp(argv[0] + len - 7, "terrier"))
+ ecc.style = &terrier;
+ else
+ ecc.style = &spitz;
+
+# ifdef VERBOSE
+ fprintf(stderr, "[");
+# endif
+
+ /* Convert data from stdin */
+ count = 0;
+ while (count < ecc.style->romsize) {
+ len = 0;
+ while (len < ecc.style->page_size) {
+ ret = TFR(read(0, buffer + len,
+ ecc.style->page_size - len));
+ if (ret <= 0)
+ break;
+ len += ret;
+ }
+ if (len == 0)
+ break;
+ if (len < ecc.style->page_size) {
+ fprintf(stderr, "\nWarning: %i stray bytes\n", len);
+ }
+
+ TFR(write(1, buffer, ecc.style->page_size));
+
+ count += len;
+ len = 0;
+ while (len < ecc.style->oob_size) {
+ ret = TFR(read(0, buffer, ecc.style->oob_size - len));
+ if (ret <= 0)
+ break;
+ len += ret;
+ }
+
+# ifdef VERBOSE
+ if (count * PBAR_LEN / ecc.style->romsize >
+ (count - ecc.style->page_size) *
+ PBAR_LEN / ecc.style->romsize)
+ fprintf(stderr, "#");
+# endif
+ }
+
+# ifdef VERBOSE
+ fprintf(stderr, "]\n");
+# endif
+ return 0;
+}
+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/tunctl.c b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/tunctl.c
new file mode 100644
index 000000000..16e24a2ad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/tunctl.c
@@ -0,0 +1,156 @@
+/* Copyright 2002 Jeff Dike
+ * Licensed under the GPL
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <grp.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+#include <linux/if_tun.h>
+
+/* TUNSETGROUP appeared in 2.6.23 */
+#ifndef TUNSETGROUP
+#define TUNSETGROUP _IOW('T', 206, int)
+#endif
+
+static void Usage(char *name)
+{
+ fprintf(stderr, "Create: %s [-b] [-u owner] [-g group] [-t device-name] "
+ "[-f tun-clone-device]\n", name);
+ fprintf(stderr, "Delete: %s -d device-name [-f tun-clone-device]\n\n",
+ name);
+ fprintf(stderr, "The default tun clone device is /dev/net/tun - some systems"
+ " use\n/dev/misc/net/tun instead\n\n");
+ fprintf(stderr, "-b will result in brief output (just the device name)\n");
+ exit(1);
+}
+
+int main(int argc, char **argv)
+{
+ struct ifreq ifr;
+ struct passwd *pw;
+ struct group *gr;
+ uid_t owner = -1;
+ gid_t group = -1;
+ int tap_fd, opt, delete = 0, brief = 0;
+ char *tun = "", *file = "/dev/net/tun", *name = argv[0], *end;
+
+ while((opt = getopt(argc, argv, "bd:f:t:u:g:")) > 0){
+ switch(opt) {
+ case 'b':
+ brief = 1;
+ break;
+ case 'd':
+ delete = 1;
+ tun = optarg;
+ break;
+ case 'f':
+ file = optarg;
+ break;
+ case 'u':
+ pw = getpwnam(optarg);
+ if(pw != NULL){
+ owner = pw->pw_uid;
+ break;
+ }
+ owner = strtol(optarg, &end, 0);
+ if(*end != '\0'){
+ fprintf(stderr, "'%s' is neither a username nor a numeric uid.\n",
+ optarg);
+ Usage(name);
+ }
+ break;
+ case 'g':
+ gr = getgrnam(optarg);
+ if(gr != NULL){
+ group = gr->gr_gid;
+ break;
+ }
+ group = strtol(optarg, &end, 0);
+ if(*end != '\0'){
+ fprintf(stderr, "'%s' is neither a groupname nor a numeric group.\n",
+ optarg);
+ Usage(name);
+ }
+ break;
+
+ case 't':
+ tun = optarg;
+ break;
+ case 'h':
+ default:
+ Usage(name);
+ }
+ }
+
+ argv += optind;
+ argc -= optind;
+
+ if(argc > 0)
+ Usage(name);
+
+ if((tap_fd = open(file, O_RDWR)) < 0){
+ fprintf(stderr, "Failed to open '%s' : ", file);
+ perror("");
+ exit(1);
+ }
+
+ memset(&ifr, 0, sizeof(ifr));
+
+ ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
+ strncpy(ifr.ifr_name, tun, sizeof(ifr.ifr_name) - 1);
+ if(ioctl(tap_fd, TUNSETIFF, (void *) &ifr) < 0){
+ perror("TUNSETIFF");
+ exit(1);
+ }
+
+ if(delete){
+ if(ioctl(tap_fd, TUNSETPERSIST, 0) < 0){
+ perror("disabling TUNSETPERSIST");
+ exit(1);
+ }
+ printf("Set '%s' nonpersistent\n", ifr.ifr_name);
+ }
+ else {
+ /* emulate behaviour prior to TUNSETGROUP */
+ if(owner == -1 && group == -1) {
+ owner = geteuid();
+ }
+
+ if(owner != -1) {
+ if(ioctl(tap_fd, TUNSETOWNER, owner) < 0){
+ perror("TUNSETOWNER");
+ exit(1);
+ }
+ }
+ if(group != -1) {
+ if(ioctl(tap_fd, TUNSETGROUP, group) < 0){
+ perror("TUNSETGROUP");
+ exit(1);
+ }
+ }
+
+ if(ioctl(tap_fd, TUNSETPERSIST, 1) < 0){
+ perror("enabling TUNSETPERSIST");
+ exit(1);
+ }
+
+ if(brief)
+ printf("%s\n", ifr.ifr_name);
+ else {
+ printf("Set '%s' persistent and owned by", ifr.ifr_name);
+ if(owner != -1)
+ printf(" uid %d", owner);
+ if(group != -1)
+ printf(" gid %d", group);
+ printf("\n");
+ }
+ }
+ return(0);
+}
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
new file mode 100644
index 000000000..a3e46a894
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-targets.inc
@@ -0,0 +1,22 @@
+# possible arch values are arm aarch64 mips mipsel mips64 mips64el ppc ppc64 ppc64abi32
+# ppcemb armeb alpha sparc32plus i386 x86_64 cris m68k microblaze sparc sparc32
+# sparc32plus
+
+def get_qemu_target_list(d):
+ import bb
+ archs = d.getVar('QEMU_TARGETS', True).split()
+ tos = d.getVar('HOST_OS', True)
+ softmmuonly = ""
+ for arch in ['ppcemb']:
+ if arch in archs:
+ softmmuonly += arch + "-softmmu,"
+ archs.remove(arch)
+ linuxuseronly = ""
+ for arch in ['armeb', 'alpha', 'ppc64abi32', 'sparc32plus']:
+ if arch in archs:
+ linuxuseronly += arch + "-linux-user,"
+ archs.remove(arch)
+ if 'linux' not in tos:
+ return softmmuonly + ''.join([arch + "-softmmu" + "," for arch in archs]).rstrip(',')
+ return softmmuonly + linuxuseronly + ''.join([arch + "-linux-user" + "," + arch + "-softmmu" + "," for arch in archs]).rstrip(',')
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc
new file mode 100644
index 000000000..269c898c4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc
@@ -0,0 +1,135 @@
+SUMMARY = "Fast open source processor emulator"
+HOMEPAGE = "http://qemu.org"
+LICENSE = "GPLv2 & LGPLv2.1"
+DEPENDS = "glib-2.0 zlib pixman"
+RDEPENDS_${PN}_class-target += "bash python"
+RDEPENDS_${PN}-ptest = "bash make"
+
+require qemu-targets.inc
+inherit autotools ptest
+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 \
+ "
+
+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 \
+ "
+export LIBTOOL="${HOST_SYS}-libtool"
+
+do_configure_prepend_class-native() {
+ # Append build host pkg-config paths for native target since the host may provide sdl
+ BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "")
+ if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
+ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
+ # link with system dbus on Ubuntu 15.10
+ # FIXME: remove below 4 lines when oe dbus is upgraded
+ if [ -r /etc/lsb-release -a "$(lsb_release -is)$(lsb_release -rs)" = "Ubuntu15.10" ] ; then
+ libs=$(PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_PATH=$BHOST_PKGCONFIG_PATH PATH=/usr/bin:/bin pkg-config --libs dbus-1 || echo "")
+ [ -n "$libs" ] && export LDFLAGS="$libs $LDFLAGS"
+ fi
+ fi
+}
+
+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
+ 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 ${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
+# binary in order to work around a segmentation fault issue. Basically, by
+# default, the reserved virtual address space for 32-on-64 bit is set to 4GB.
+# This will trigger a MMU access fault in the virtual CPU. With this change,
+# the qemu-mips works fine.
+# IMPORTANT: This piece needs to be removed once the root cause is fixed!
+do_install_append() {
+ if [ -e "${D}/${bindir}/qemu-mips" ]; then
+ create_wrapper ${D}/${bindir}/qemu-mips \
+ QEMU_RESERVED_VA=0x0
+ fi
+}
+# END of qemu-mips workaround
+
+PACKAGECONFIG ??= " \
+ fdt sdl \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen', '', d)} \
+ "
+PACKAGECONFIG_class-native ??= "fdt alsa uuid"
+PACKAGECONFIG_class-nativesdk ??= "fdt sdl"
+NATIVEDEPS = ""
+NATIVEDEPS_class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libxext-native', '',d)}"
+PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl ${NATIVEDEPS},"
+PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr,"
+PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio,"
+PACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs,"
+PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen,xen-libxenstore xen-libxenctrl xen-libxenguest"
+PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl,"
+PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg,"
+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 --enable-vte,--disable-gtk --disable-vte,gtk+ libvte,"
+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[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[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"
+
+EXTRA_OECONF += "${@bb.utils.contains('PACKAGECONFIG', 'alsa', '--audio-drv-list=oss,alsa', '', d)}"
+
+INSANE_SKIP_${PN} = "arch"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-1568.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-1568.patch
new file mode 100644
index 000000000..56fd346ae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-1568.patch
@@ -0,0 +1,46 @@
+From 4ab0359a8ae182a7ac5c99609667273167703fab Mon Sep 17 00:00:00 2001
+From: Prasad J Pandit <pjp@fedoraproject.org>
+Date: Mon, 11 Jan 2016 14:10:42 -0500
+Subject: [PATCH] ide: ahci: reset ncq object to unused on error
+
+When processing NCQ commands, AHCI device emulation prepares a
+NCQ transfer object; To which an aio control block(aiocb) object
+is assigned in 'execute_ncq_command'. In case, when the NCQ
+command is invalid, the 'aiocb' object is not assigned, and NCQ
+transfer object is left as 'used'. This leads to a use after
+free kind of error in 'bdrv_aio_cancel_async' via 'ahci_reset_port'.
+Reset NCQ transfer object to 'unused' to avoid it.
+
+[Maintainer edit: s/ACHI/AHCI/ in the commit message. --js]
+
+Reported-by: Qinghao Tang <luodalongde@gmail.com>
+Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
+Reviewed-by: John Snow <jsnow@redhat.com>
+Message-id: 1452282511-4116-1-git-send-email-ppandit@redhat.com
+Signed-off-by: John Snow <jsnow@redhat.com>
+
+Upstream-Status: Backport
+
+http://git.qemu.org/?p=qemu.git;a=commit;h=4ab0359a8ae182a7ac5c99609667273167703fab
+
+CVE: CVE-2016-1568
+[Yocto # 9013]
+
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ hw/ide/ahci.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: qemu-2.5.0/hw/ide/ahci.c
+===================================================================
+--- qemu-2.5.0.orig/hw/ide/ahci.c
++++ qemu-2.5.0/hw/ide/ahci.c
+@@ -910,6 +910,7 @@ static void ncq_err(NCQTransferState *nc
+ ide_state->error = ABRT_ERR;
+ ide_state->status = READY_STAT | ERR_STAT;
+ ncq_tfs->drive->port_regs.scr_err |= (1 << ncq_tfs->tag);
++ ncq_tfs->used = 0;
+ }
+
+ static void ncq_finish(NCQTransferState *ncq_tfs)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch
new file mode 100644
index 000000000..946435c43
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch
@@ -0,0 +1,59 @@
+From: Prasad J Pandit <address@hidden>
+
+When IDE AHCI emulation uses Frame Information Structures(FIS)
+engine for data transfer, the mapped FIS buffer address is stored
+in a static 'bounce.buffer'. When a request is made to map another
+memory region, address_space_map() returns NULL because
+'bounce.buffer' is in_use. It leads to a null pointer dereference
+error while doing 'dma_memory_unmap'. Add a check to avoid it.
+
+Reported-by: Zuozhi fzz <address@hidden>
+Signed-off-by: Prasad J Pandit <address@hidden>
+
+Upstream-Status: Backport
+https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05740.html
+
+CVE: CVE-2016-2197
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ hw/ide/ahci.c | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+ Update as per review
+ -> https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05715.html
+
+Index: qemu-2.5.0/hw/ide/ahci.c
+===================================================================
+--- qemu-2.5.0.orig/hw/ide/ahci.c
++++ qemu-2.5.0/hw/ide/ahci.c
+@@ -661,9 +661,11 @@ static bool ahci_map_fis_address(AHCIDev
+
+ static void ahci_unmap_fis_address(AHCIDevice *ad)
+ {
+- dma_memory_unmap(ad->hba->as, ad->res_fis, 256,
+- DMA_DIRECTION_FROM_DEVICE, 256);
+- ad->res_fis = NULL;
++ if (ad->res_fis) {
++ dma_memory_unmap(ad->hba->as, ad->res_fis, 256,
++ DMA_DIRECTION_FROM_DEVICE, 256);
++ ad->res_fis = NULL;
++ }
+ }
+
+ static bool ahci_map_clb_address(AHCIDevice *ad)
+@@ -677,9 +679,11 @@ static bool ahci_map_clb_address(AHCIDev
+
+ static void ahci_unmap_clb_address(AHCIDevice *ad)
+ {
+- dma_memory_unmap(ad->hba->as, ad->lst, 1024,
+- DMA_DIRECTION_FROM_DEVICE, 1024);
+- ad->lst = NULL;
++ if (ad->lst) {
++ dma_memory_unmap(ad->hba->as, ad->lst, 1024,
++ DMA_DIRECTION_FROM_DEVICE, 1024);
++ ad->lst = NULL;
++ }
+ }
+
+ static void ahci_write_fis_sdb(AHCIState *s, NCQTransferState *ncq_tfs)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2198.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2198.patch
new file mode 100644
index 000000000..f1201f061
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2198.patch
@@ -0,0 +1,45 @@
+From: Prasad J Pandit <address@hidden>
+
+USB Ehci emulation supports host controller capability registers.
+But its mmio '.write' function was missing, which lead to a null
+pointer dereference issue. Add a do nothing 'ehci_caps_write'
+definition to avoid it; Do nothing because capability registers
+are Read Only(RO).
+
+Reported-by: Zuozhi Fzz <address@hidden>
+Signed-off-by: Prasad J Pandit <address@hidden>
+
+Upstream-Status: Backport
+https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05899.html
+
+CVE: CVE-2016-2198
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ hw/usb/hcd-ehci.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+Index: qemu-2.5.0/hw/usb/hcd-ehci.c
+===================================================================
+--- qemu-2.5.0.orig/hw/usb/hcd-ehci.c
++++ qemu-2.5.0/hw/usb/hcd-ehci.c
+@@ -893,6 +893,11 @@ static uint64_t ehci_caps_read(void *ptr
+ return s->caps[addr];
+ }
+
++static void ehci_caps_write(void *ptr, hwaddr addr,
++ uint64_t val, unsigned size)
++{
++}
++
+ static uint64_t ehci_opreg_read(void *ptr, hwaddr addr,
+ unsigned size)
+ {
+@@ -2310,6 +2315,7 @@ static void ehci_frame_timer(void *opaqu
+
+ static const MemoryRegionOps ehci_mmio_caps_ops = {
+ .read = ehci_caps_read,
++ .write = ehci_caps_write,
+ .valid.min_access_size = 1,
+ .valid.max_access_size = 4,
+ .impl.min_access_size = 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
new file mode 100644
index 000000000..1a6cf5119
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch
@@ -0,0 +1,46 @@
+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/add-ptest-in-makefile.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch
new file mode 100644
index 000000000..a99f72098
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+Add subpackage -ptest which runs all unit test cases for qemu.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ tests/Makefile | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/tests/Makefile b/tests/Makefile
+index 88f7105..3f40b4b 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -405,3 +405,12 @@ all: $(QEMU_IOTESTS_HELPERS-y)
+
+ -include $(wildcard tests/*.d)
+ -include $(wildcard tests/libqos/*.d)
++
++buildtest-TESTS: $(check-unit-y)
++
++runtest-TESTS:
++ for f in $(check-unit-y); do \
++ nf=$$(echo $$f | sed 's/tests\//\.\//g'); \
++ $$nf; \
++ done
++
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/configure-fix-Darwin-target-detection.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/configure-fix-Darwin-target-detection.patch
new file mode 100644
index 000000000..59cdc1c30
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/configure-fix-Darwin-target-detection.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+
+From 9ac096d8eccf2d56ece646320c282c8369f8337c Mon Sep 17 00:00:00 2001
+From: Cristian Iorga <cristian.iorga@intel.com>
+Date: Tue, 29 Jul 2014 18:35:59 +0300
+Subject: [PATCH] configure: fix Darwin target detection
+
+fix Darwin target detection for qemu
+cross-compilation.
+
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+---
+ configure | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure b/configure
+index 283c71c..1c66a11 100755
+--- a/configure
++++ b/configure
+@@ -444,6 +444,8 @@ elif check_define __sun__ ; then
+ targetos='SunOS'
+ elif check_define __HAIKU__ ; then
+ targetos='Haiku'
++elif check_define __APPLE__ ; then
++ targetos='Darwin'
+ else
+ targetos=`uname -s`
+ fi
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch
new file mode 100644
index 000000000..682213254
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch
@@ -0,0 +1,76 @@
+From 697a834c35d19447b7dcdb9e1d9434bc6ce17c21 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Wed, 12 Aug 2015 15:11:30 -0500
+Subject: [PATCH] cpus.c: Add error messages when qemi_cpu_kick_thread fails.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Add custom_debug.h with function for print backtrace information.
+When pthread_kill fails in qemu_cpu_kick_thread display backtrace and
+current cpu information.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ cpus.c | 5 +++++
+ custom_debug.h | 24 ++++++++++++++++++++++++
+ 2 files changed, 29 insertions(+)
+ create mode 100644 custom_debug.h
+
+diff --git a/cpus.c b/cpus.c
+index a822ce3..7e4786e 100644
+--- a/cpus.c
++++ b/cpus.c
+@@ -1080,6 +1080,8 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
+ return NULL;
+ }
+
++#include "custom_debug.h"
++
+ static void qemu_cpu_kick_thread(CPUState *cpu)
+ {
+ #ifndef _WIN32
+@@ -1088,6 +1090,9 @@ static void qemu_cpu_kick_thread(CPUState *cpu)
+ err = pthread_kill(cpu->thread->thread, SIG_IPI);
+ if (err) {
+ fprintf(stderr, "qemu:%s: %s", __func__, strerror(err));
++ fprintf(stderr, "CPU #%d:\n", cpu->cpu_index);
++ cpu_dump_state(cpu, stderr, fprintf, 0);
++ backtrace_print();
+ exit(1);
+ }
+ #else /* _WIN32 */
+diff --git a/custom_debug.h b/custom_debug.h
+new file mode 100644
+index 0000000..f029e45
+--- /dev/null
++++ b/custom_debug.h
+@@ -0,0 +1,24 @@
++#include <execinfo.h>
++#include <stdio.h>
++#define BACKTRACE_MAX 128
++static void backtrace_print(void)
++{
++ int nfuncs = 0;
++ void *buf[BACKTRACE_MAX];
++ char **symbols;
++ int i;
++
++ nfuncs = backtrace(buf, BACKTRACE_MAX);
++
++ symbols = backtrace_symbols(buf, nfuncs);
++ if (symbols == NULL) {
++ fprintf(stderr, "backtrace_print failed to get symbols");
++ return;
++ }
++
++ fprintf(stderr, "Backtrace ...\n");
++ for (i = 0; i < nfuncs; i++)
++ fprintf(stderr, "%s\n", symbols[i]);
++
++ free(symbols);
++}
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch
new file mode 100644
index 000000000..41726b1c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch
@@ -0,0 +1,72 @@
+When the pointer enters the Qemu window it calls SDL_WM_GrabInput, which calls
+XGrabPointer in a busyloop until it returns GrabSuccess. However if there's already
+a pointer grab (screen is locked, a menu is open) then qemu will hang until the
+grab can be taken. In the specific case of a headless X server on an autobuilder, once
+the screensaver has kicked in any qemu instance that appears underneath the
+pointer will hang.
+
+I'm not entirely sure why pointer grabs are required (the documentation
+explicitly says it doesn't do grabs when using a tablet, which we are) so wrap
+them in a conditional that can be set by the autobuilder environment, preserving
+the current grabbing behaviour for everyone else.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 4b1988ecb01a178269ec0513a75f2ec620c7ef6a Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Wed, 18 Sep 2013 14:04:54 +0100
+Subject: [PATCH] sdl.c: allow user to disable pointer grabs
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Eric Bénard <eric@eukrea.com>
+---
+ ui/sdl.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/ui/sdl.c b/ui/sdl.c
+index 39a42d6..9b8abe5 100644
+--- a/ui/sdl.c
++++ b/ui/sdl.c
+@@ -59,6 +59,10 @@ static SDL_Cursor *guest_sprite = NULL;
+ static SDL_PixelFormat host_format;
+ static int scaling_active = 0;
+ static Notifier mouse_mode_notifier;
++#ifndef True
++#define True 1
++#endif
++static doing_grabs = True;
+
+ static void sdl_update(DisplayChangeListener *dcl,
+ int x, int y, int w, int h)
+@@ -384,14 +388,16 @@ static void sdl_grab_start(void)
+ SDL_WarpMouse(guest_x, guest_y);
+ } else
+ sdl_hide_cursor();
+- SDL_WM_GrabInput(SDL_GRAB_ON);
++ if (doing_grabs)
++ SDL_WM_GrabInput(SDL_GRAB_ON);
+ gui_grab = 1;
+ sdl_update_caption();
+ }
+
+ static void sdl_grab_end(void)
+ {
+- SDL_WM_GrabInput(SDL_GRAB_OFF);
++ if (doing_grabs)
++ SDL_WM_GrabInput(SDL_GRAB_OFF);
+ gui_grab = 0;
+ sdl_show_cursor();
+ sdl_update_caption();
+@@ -909,6 +915,8 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
+ * This requires SDL >= 1.2.14. */
+ setenv("SDL_DISABLE_LOCK_KEYS", "1", 1);
+
++ doing_grabs = (getenv("QEMU_DONT_GRAB") == NULL);
++
+ flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
+ if (SDL_Init (flags)) {
+ fprintf(stderr, "Could not initialize SDL(%s) - exiting\n",
+--
+1.8.3.1
+
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
new file mode 100644
index 000000000..171bda7e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch
@@ -0,0 +1,93 @@
+[PATCH] exclude some arm EABI obsolete syscalls
+
+Upstream-Status: Pending
+
+some syscalls are obsolete and no longer available for EABI, exclude them to
+fix the below error:
+ In file included from qemu-seccomp.c:16:0:
+ qemu-seccomp.c:28:7: error: '__NR_select' undeclared here (not in a function)
+ { SCMP_SYS(select), 252 },
+ ^
+ qemu-seccomp.c:36:7: error: '__NR_mmap' undeclared here (not in a function)
+ { SCMP_SYS(mmap), 247 },
+ ^
+ qemu-seccomp.c:57:7: error: '__NR_getrlimit' undeclared here (not in a function)
+ { SCMP_SYS(getrlimit), 245 },
+ ^
+ qemu-seccomp.c:96:7: error: '__NR_time' undeclared here (not in a function)
+ { SCMP_SYS(time), 245 },
+ ^
+ qemu-seccomp.c:185:7: error: '__NR_alarm' undeclared here (not in a function)
+ { SCMP_SYS(alarm), 241 },
+
+please refer source files:
+ arch/arm/include/uapi/asm/unistd.h
+or kernel header:
+ /usr/include/asm/unistd.h
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ qemu-seccomp.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/qemu-seccomp.c b/qemu-seccomp.c
+index caa926e..5a78502 100644
+--- a/qemu-seccomp.c
++++ b/qemu-seccomp.c
+@@ -25,15 +25,21 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+ { SCMP_SYS(timer_settime), 255 },
+ { SCMP_SYS(timer_gettime), 254 },
+ { SCMP_SYS(futex), 253 },
++#if !defined(__ARM_EABI__)
+ { SCMP_SYS(select), 252 },
++ { SCMP_SYS(time), 245 },
++ { SCMP_SYS(alarm), 241 },
++ { SCMP_SYS(getrlimit), 245 },
++ { SCMP_SYS(mmap), 247 },
++ { SCMP_SYS(socketcall), 250 },
++ { SCMP_SYS(ipc), 245 },
++#endif
+ { SCMP_SYS(recvfrom), 251 },
+ { SCMP_SYS(sendto), 250 },
+- { SCMP_SYS(socketcall), 250 },
+ { SCMP_SYS(read), 249 },
+ { SCMP_SYS(io_submit), 249 },
+ { SCMP_SYS(brk), 248 },
+ { SCMP_SYS(clone), 247 },
+- { SCMP_SYS(mmap), 247 },
+ { SCMP_SYS(mprotect), 246 },
+ { SCMP_SYS(execve), 245 },
+ { SCMP_SYS(open), 245 },
+@@ -48,13 +54,11 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+ { SCMP_SYS(bind), 245 },
+ { SCMP_SYS(listen), 245 },
+ { SCMP_SYS(semget), 245 },
+- { SCMP_SYS(ipc), 245 },
+ { 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[] = {
+ { SCMP_SYS(times), 245 },
+ { SCMP_SYS(exit), 245 },
+ { SCMP_SYS(clock_gettime), 245 },
+- { SCMP_SYS(time), 245 },
+ { SCMP_SYS(restart_syscall), 245 },
+ { SCMP_SYS(pwrite64), 245 },
+ { SCMP_SYS(nanosleep), 245 },
+@@ -182,7 +185,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+ { SCMP_SYS(lstat64), 241 },
+ { SCMP_SYS(sendfile64), 241 },
+ { SCMP_SYS(ugetrlimit), 241 },
+- { SCMP_SYS(alarm), 241 },
+ { SCMP_SYS(rt_sigsuspend), 241 },
+ { SCMP_SYS(rt_sigqueueinfo), 241 },
+ { SCMP_SYS(rt_tgsigqueueinfo), 241 },
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch
new file mode 100644
index 000000000..13a6ea23b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch
@@ -0,0 +1,84 @@
+fix libcap header issue on some distro
+
+1, When build qemu-native on SLED 11.2, there is an error:
+...
+| In file included from /usr/include/bits/sigcontext.h:28,
+| from /usr/include/signal.h:339,
+| from /buildarea2/tmp/work/i686-linux/qemu-native/1.4.0-r0/
+qemu-1.4.0/include/qemu-common.h:42,
+| from fsdev/virtfs-proxy-helper.c:23:
+| /usr/include/asm/sigcontext.h:28: error: expected specifier-
+qualifier-list before '__u64'
+| /usr/include/asm/sigcontext.h:191: error: expected specifier-
+qualifier-list before '__u64'
+...
+
+2, The virtfs-proxy-helper.c includes <sys/capability.h> and
+qemu-common.h in sequence. The header include map is:
+(`-->' presents `include')
+...
+"virtfs-proxy-helper.c" --> <sys/capability.h>
+...
+"virtfs-proxy-helper.c" --> "qemu-common.h" --> <signal.h> -->
+<bits/sigcontext.h> --> <asm/sigcontext.h> --> <linux/types.h> -->
+<asm/types.h> --> <asm-generic/types.h> --> <asm-generic/int-ll64.h>
+...
+
+3, The bug is found on SLED 11.2 x86. In libcap header file
+/usr/include/sys/capability.h, it does evil stuff like this:
+...
+ 25 /*
+ 26 * Make sure we can be included from userland by preventing
+ 27 * capability.h from including other kernel headers
+ 28 */
+ 29 #define _LINUX_TYPES_H
+ 30 #define _LINUX_FS_H
+ 31 #define __LINUX_COMPILER_H
+ 32 #define __user
+ 33
+ 34 typedef unsigned int __u32;
+ 35 typedef __u32 __le32;
+...
+This completely prevents including /usr/include/linux/types.h.
+The above `<asm/sigcontext.h> --> <linux/types.h>' is prevented,
+and '__u64' is defined in <asm-generic/int-ll64.h>.
+
+4, Modify virtfs-proxy-helper.c to include <sys/capability.h>
+last to workaround the issue.
+
+http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html
+http://patchwork.linuxtv.org/patch/12748/
+
+Upstream-Status: Pending
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ fsdev/virtfs-proxy-helper.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
+--- a/fsdev/virtfs-proxy-helper.c
++++ b/fsdev/virtfs-proxy-helper.c
+@@ -12,7 +12,6 @@
+ #include <sys/resource.h>
+ #include <getopt.h>
+ #include <syslog.h>
+-#include <sys/capability.h>
+ #include <sys/fsuid.h>
+ #include <sys/vfs.h>
+ #include <sys/ioctl.h>
+@@ -26,7 +25,11 @@
+ #include "virtio-9p-marshal.h"
+ #include "hw/9pfs/virtio-9p-proxy.h"
+ #include "fsdev/virtio-9p-marshal.h"
+-
++/*
++ * Include this one last due to some versions of it being buggy:
++ * http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html
++ */
++#include <sys/capability.h>
+ #define PROGNAME "virtfs-proxy-helper"
+
+ #ifndef XFS_SUPER_MAGIC
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/no-valgrind.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/no-valgrind.patch
new file mode 100644
index 000000000..91f728042
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/no-valgrind.patch
@@ -0,0 +1,19 @@
+There isn't an option to enable or disable valgrind support, so disable it to avoid non-deterministic builds.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure b/configure
+index b3c4f51..4d3929e 100755
+--- a/configure
++++ b/configure
+@@ -4193,9 +4192,0 @@ valgrind_h=no
+-cat > $TMPC << EOF
+-#include <valgrind/valgrind.h>
+-int main(void) {
+- return 0;
+-}
+-EOF
+-if compile_prog "" "" ; then
+- valgrind_h=yes
+-fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/pathlimit.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/pathlimit.patch
new file mode 100644
index 000000000..57ab981c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/pathlimit.patch
@@ -0,0 +1,137 @@
+By default qemu builds a complete list of directories within the user
+emulation sysroot (-L option). The OE sysroot directory is large and
+this is confusing, for example it indexes all pkgdata. In particular this
+confuses strace of qemu binaries with tons of irrelevant paths.
+
+This patch stops the code indexing up front and instead only indexes
+things if/as/when it needs to. This drastically reduces the files it
+reads and reduces memory usage and cleans up strace.
+
+It would also avoid the infinite directory traversal bug in [YOCTO #6996]
+although the code could still be vulnerable if it parsed those specific
+paths.
+
+RP
+2016/3/9
+Upstream-Status: Pending
+
+Index: qemu-2.5.0/util/path.c
+===================================================================
+--- qemu-2.5.0.orig/util/path.c
++++ qemu-2.5.0/util/path.c
+@@ -19,6 +19,7 @@ struct pathelem
+ char *name;
+ /* Full path name, eg. /usr/gnemul/x86-linux/lib. */
+ char *pathname;
++ int populated_entries;
+ struct pathelem *parent;
+ /* Children */
+ unsigned int num_entries;
+@@ -49,6 +50,7 @@ static struct pathelem *new_entry(const
+ new->name = g_strdup(name);
+ new->pathname = g_strdup_printf("%s/%s", root, name);
+ new->num_entries = 0;
++ new->populated_entries = 0;
+ return new;
+ }
+
+@@ -57,15 +59,16 @@ static struct pathelem *new_entry(const
+ /* Not all systems provide this feature */
+ #if defined(DT_DIR) && defined(DT_UNKNOWN) && defined(DT_LNK)
+ # define dirent_type(dirent) ((dirent)->d_type)
+-# define is_dir_maybe(type) \
+- ((type) == DT_DIR || (type) == DT_UNKNOWN || (type) == DT_LNK)
++# define is_not_dir(type) \
++ ((type) != DT_DIR && (type) != DT_UNKNOWN && (type) != DT_LNK)
+ #else
+ # define dirent_type(dirent) (1)
+-# define is_dir_maybe(type) (type)
++# define is_not_dir(type) (0)
+ #endif
+
+ static struct pathelem *add_dir_maybe(struct pathelem *path)
+ {
++ unsigned int i;
+ DIR *dir;
+
+ if ((dir = opendir(path->pathname)) != NULL) {
+@@ -78,6 +81,11 @@ static struct pathelem *add_dir_maybe(st
+ }
+ closedir(dir);
+ }
++
++ for (i = 0; i < path->num_entries; i++)
++ (path->entries[i])->parent = path;
++
++ path->populated_entries = 1;
+ return path;
+ }
+
+@@ -93,26 +101,16 @@ static struct pathelem *add_entry(struct
+ e = &root->entries[root->num_entries-1];
+
+ *e = new_entry(root->pathname, root, name);
+- if (is_dir_maybe(type)) {
+- *e = add_dir_maybe(*e);
++ if (is_not_dir(type)) {
++ (*e)->populated_entries = 1;
+ }
+
+ return root;
+ }
+
+-/* This needs to be done after tree is stabilized (ie. no more reallocs!). */
+-static void set_parents(struct pathelem *child, struct pathelem *parent)
+-{
+- unsigned int i;
+-
+- child->parent = parent;
+- for (i = 0; i < child->num_entries; i++)
+- set_parents(child->entries[i], child);
+-}
+-
+ /* FIXME: Doesn't handle DIR/.. where DIR is not in emulated dir. */
+ static const char *
+-follow_path(const struct pathelem *cursor, const char *name)
++follow_path(struct pathelem *cursor, struct pathelem **source, const char *name)
+ {
+ unsigned int i, namelen;
+
+@@ -123,14 +121,18 @@ follow_path(const struct pathelem *curso
+ return cursor->pathname;
+
+ if (strneq(name, namelen, ".."))
+- return follow_path(cursor->parent, name + namelen);
++ return follow_path(cursor->parent, &cursor->parent, name + namelen);
+
+ if (strneq(name, namelen, "."))
+- return follow_path(cursor, name + namelen);
++ return follow_path(cursor, source, name + namelen);
++
++ if (!cursor->populated_entries)
++ *source = add_dir_maybe(cursor);
++ cursor = *source;
+
+ for (i = 0; i < cursor->num_entries; i++)
+ if (strneq(name, namelen, cursor->entries[i]->name))
+- return follow_path(cursor->entries[i], name + namelen);
++ return follow_path(cursor->entries[i], &cursor->entries[i], name + namelen);
+
+ /* Not found */
+ return NULL;
+@@ -164,8 +166,6 @@ void init_paths(const char *prefix)
+ g_free(base->name);
+ g_free(base);
+ base = NULL;
+- } else {
+- set_parents(base, base);
+ }
+ }
+
+@@ -177,5 +177,5 @@ const char *path(const char *name)
+ if (!base || !name || name[0] != '/')
+ return name;
+
+- return follow_path(base, name) ?: name;
++ return follow_path(base, &base, name) ?: name;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/powerpc_rom.bin b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/powerpc_rom.bin
new file mode 100644
index 000000000..c4044296c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/powerpc_rom.bin
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch
new file mode 100644
index 000000000..c7425ab8d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch
@@ -0,0 +1,31 @@
+qemu: Add addition environment space to boot loader qemu-system-mips
+
+Upstream-Status: Inappropriate - OE uses deep paths
+
+If you create a project with very long directory names like 128 characters
+deep and use NFS, the kernel arguments will be truncated. The kernel will
+accept longer strings such as 1024 bytes, but the qemu boot loader defaulted
+to only 256 bytes. This patch expands the limit.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ hw/mips/mips_malta.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
+index 9d521cc..17c0391 100644
+--- a/hw/mips/mips_malta.c
++++ b/hw/mips/mips_malta.c
+@@ -53,7 +53,7 @@
+
+ #define ENVP_ADDR 0x80002000l
+ #define ENVP_NB_ENTRIES 16
+-#define ENVP_ENTRY_SIZE 256
++#define ENVP_ENTRY_SIZE 1024
+
+ /* Hardware addresses */
+ #define FLASH_ADDRESS 0x1e000000ULL
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/run-ptest
new file mode 100644
index 000000000..f4b8e97e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/run-ptest
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+#This script is used to run qemu test suites
+ptestdir=$(pwd)
+cd tests
+
+export SRC_PATH=$ptestdir
+make -k runtest-TESTS | sed '/: OK/ s/^/PASS: /g'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/wacom.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/wacom.patch
new file mode 100644
index 000000000..cd06aa4ac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/wacom.patch
@@ -0,0 +1,130 @@
+The USB wacom device is missing a HID descriptor which causes it
+to fail to operate with recent kernels (e.g. 3.17).
+
+This patch adds a HID desriptor to the device, based upon one from
+real wcom device.
+
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Upstream-Status: Submitted
+2014/11/27
+
+Index: qemu-2.1.0/hw/usb/dev-wacom.c
+===================================================================
+--- qemu-2.1.0.orig/hw/usb/dev-wacom.c 2014-08-01 15:12:17.000000000 +0100
++++ qemu-2.1.0/hw/usb/dev-wacom.c 2014-10-12 12:13:30.540306042 +0100
+@@ -68,6 +68,89 @@
+ [STR_SERIALNUMBER] = "1",
+ };
+
++static const uint8_t qemu_tablet_hid_report_descriptor[] = {
++ 0x05, 0x01, /* Usage Page (Generic Desktop) */
++ 0x09, 0x02, /* Usage (Mouse) */
++ 0xa1, 0x01, /* Collection (Application) */
++ 0x85, 0x01, /* Report ID (1) */
++ 0x09, 0x01, /* Usage (Pointer) */
++ 0xa1, 0x00, /* Collection (Physical) */
++ 0x05, 0x09, /* Usage Page (Button) */
++ 0x19, 0x01, /* Usage Minimum (1) */
++ 0x29, 0x05, /* Usage Maximum (5) */
++ 0x15, 0x00, /* Logical Minimum (0) */
++ 0x25, 0x01, /* Logical Maximum (1) */
++ 0x95, 0x05, /* Report Count (5) */
++ 0x75, 0x01, /* Report Size (1) */
++ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
++ 0x95, 0x01, /* Report Count (1) */
++ 0x75, 0x03, /* Report Size (3) */
++ 0x81, 0x01, /* Input (Constant) */
++ 0x05, 0x01, /* Usage Page (Generic Desktop) */
++ 0x09, 0x30, /* Usage (X) */
++ 0x09, 0x31, /* Usage (Y) */
++ 0x15, 0x81, /* Logical Minimum (-127) */
++ 0x25, 0x7f, /* Logical Maximum (127) */
++ 0x75, 0x08, /* Report Size (8) */
++ 0x95, 0x02, /* Report Count (2) */
++ 0x81, 0x06, /* Input (Data, Variable, Relative) */
++ 0xc0, /* End Collection */
++ 0xc0, /* End Collection */
++ 0x05, 0x0d, /* Usage Page (Digitizer) */
++ 0x09, 0x01, /* Usage (Digitizer) */
++ 0xa1, 0x01, /* Collection (Application) */
++ 0x85, 0x02, /* Report ID (2) */
++ 0xa1, 0x00, /* Collection (Physical) */
++ 0x06, 0x00, 0xff, /* Usage Page (Vendor 0xff00) */
++ 0x09, 0x01, /* Usage (Digitizer) */
++ 0x15, 0x00, /* Logical Minimum (0) */
++ 0x26, 0xff, 0x00, /* Logical Maximum (255) */
++ 0x75, 0x08, /* Report Size (8) */
++ 0x95, 0x08, /* Report Count (8) */
++ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
++ 0xc0, /* End Collection */
++ 0x09, 0x01, /* Usage (Digitizer) */
++ 0x85, 0x02, /* Report ID (2) */
++ 0x95, 0x01, /* Report Count (1) */
++ 0xb1, 0x02, /* FEATURE (2) */
++ 0xc0, /* End Collection */
++ 0x06, 0x00, 0xff, /* Usage Page (Vendor 0xff00) */
++ 0x09, 0x01, /* Usage (Digitizer) */
++ 0xa1, 0x01, /* Collection (Application) */
++ 0x85, 0x02, /* Report ID (2) */
++ 0x05, 0x0d, /* Usage Page (Digitizer) */
++ 0x09, 0x22, /* Usage (Finger) */
++ 0xa1, 0x00, /* Collection (Physical) */
++ 0x06, 0x00, 0xff, /* Usage Page (Vendor 0xff00) */
++ 0x09, 0x01, /* Usage (Digitizer) */
++ 0x15, 0x00, /* Logical Minimum (0) */
++ 0x26, 0xff, 0x00, /* Logical Maximum */
++ 0x75, 0x08, /* Report Size (8) */
++ 0x95, 0x02, /* Report Count (2) */
++ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
++ 0x05, 0x01, /* Usage Page (Generic Desktop) */
++ 0x09, 0x30, /* Usage (X) */
++ 0x35, 0x00, /* Physical Minimum */
++ 0x46, 0xe0, 0x2e, /* Physical Maximum */
++ 0x26, 0xe0, 0x01, /* Logical Maximum */
++ 0x75, 0x10, /* Report Size (16) */
++ 0x95, 0x01, /* Report Count (1) */
++ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
++ 0x09, 0x31, /* Usage (Y) */
++ 0x46, 0x40, 0x1f, /* Physical Maximum */
++ 0x26, 0x40, 0x01, /* Logical Maximum */
++ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
++ 0x06, 0x00, 0xff, /* Usage Page (Vendor 0xff00) */
++ 0x09, 0x01, /* Usage (Digitizer) */
++ 0x26, 0xff, 0x00, /* Logical Maximum */
++ 0x75, 0x08, /* Report Size (8) */
++ 0x95, 0x0d, /* Report Count (13) */
++ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
++ 0xc0, /* End Collection */
++ 0xc0, /* End Collection */
++};
++
++
+ static const USBDescIface desc_iface_wacom = {
+ .bInterfaceNumber = 0,
+ .bNumEndpoints = 1,
+@@ -85,7 +168,7 @@
+ 0x00, /* u8 country_code */
+ 0x01, /* u8 num_descriptors */
+ 0x22, /* u8 type: Report */
+- 0x6e, 0, /* u16 len */
++ sizeof(qemu_tablet_hid_report_descriptor), 0, /* u16 len */
+ },
+ },
+ },
+@@ -265,6 +350,15 @@
+ }
+
+ switch (request) {
++ case InterfaceRequest | USB_REQ_GET_DESCRIPTOR:
++ switch (value >> 8) {
++ case 0x22:
++ memcpy(data, qemu_tablet_hid_report_descriptor,
++ sizeof(qemu_tablet_hid_report_descriptor));
++ p->actual_length = sizeof(qemu_tablet_hid_report_descriptor);
++ break;
++ }
++ break;
+ case WACOM_SET_REPORT:
+ if (s->mouse_grabbed) {
+ qemu_remove_mouse_event_handler(s->eh_entry);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.5.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.5.0.bb
new file mode 100644
index 000000000..e9d9a8dce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.5.0.bb
@@ -0,0 +1,24 @@
+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://CVE-2016-1568.patch \
+ file://CVE-2016-2197.patch \
+ file://CVE-2016-2198.patch \
+ file://pathlimit.patch \
+ "
+SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
+SRC_URI[md5sum] = "f469f2330bbe76e3e39db10e9ac4f8db"
+SRC_URI[sha256sum] = "3443887401619fe33bfa5d900a4f2d6a79425ae2b7e43d5b8c36eb7a683772d4"
+
+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/qemuwrapper-cross_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
new file mode 100644
index 000000000..7f4c6d934
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
@@ -0,0 +1,50 @@
+SUMMARY = "QEMU wrapper script"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+S = "${WORKDIR}"
+
+inherit qemu
+
+do_install () {
+ install -d ${D}${bindir_crossscripts}/
+
+ echo "#!/bin/sh" > ${D}${bindir_crossscripts}/qemuwrapper
+ qemu_binary=${@qemu_target_binary(d)}
+ qemu_options='${QEMU_OPTIONS}'
+ echo "$qemu_binary $qemu_options \"\$@\"" >> ${D}${bindir_crossscripts}/qemuwrapper
+ fallback_qemu_bin=
+ case $qemu_binary in
+ "qemu-i386")
+ fallback_qemu_bin=qemu-x86_64
+ ;;
+ "qemu-x86_64")
+ fallback_qemu_bin=qemu-i386
+ ;;
+ *)
+ ;;
+ esac
+
+ if [ -n "$fallback_qemu_bin" ]; then
+
+ cat >> ${D}${bindir_crossscripts}/qemuwrapper << EOF
+rc=\$?
+if [ \$rc = 255 ]; then
+ $fallback_qemu_bin "\$@"
+ rc=\$?
+fi
+exit \$rc
+EOF
+
+ fi
+
+ chmod +x ${D}${bindir_crossscripts}/qemuwrapper
+}
+
+SYSROOT_PREPROCESS_FUNCS += "qemuwrapper_sysroot_preprocess"
+
+qemuwrapper_sysroot_preprocess () {
+ sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
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
new file mode 100644
index 000000000..5c4b0a217
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native.inc
@@ -0,0 +1,18 @@
+RDEPENDS_${PN} = "diffstat-native patch-native bzip2-native util-linux-native"
+
+INHIBIT_AUTOTOOLS_DEPS = "1"
+
+inherit native
+
+PATCHTOOL = "patch"
+EXTRA_OECONF = "--disable-nls"
+
+do_configure () {
+ oe_runconf
+}
+
+do_install_append () {
+ # Dummy quiltrc file for patch.bbclass
+ install -d ${D}${sysconfdir}/
+ touch ${D}${sysconfdir}/quiltrc
+}
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.64.bb
new file mode 100644
index 000000000..6bc7dcdb7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt-native_0.64.bb
@@ -0,0 +1,2 @@
+require quilt.inc
+require quilt-native.inc
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt.inc b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt.inc
new file mode 100644
index 000000000..4e393c4d8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt.inc
@@ -0,0 +1,64 @@
+SUMMARY = "Tool for working with series of patches"
+HOMEPAGE = "http://savannah.nongnu.org/projects/quilt/"
+SECTION = "devel"
+LICENSE = "GPLv2"
+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 \
+"
+
+SRC_URI[md5sum] = "fc0310db5868a0873d602d4332a76d43"
+SRC_URI[sha256sum] = "c4bfd3282214a288e8d3e921ae4d52e73e24c4fead72b5446752adee99a7affd"
+
+inherit autotools-brokensep ptest
+
+EXTRA_OECONF_darwin += "--without-date \
+ --without-getopt \
+ "
+
+CLEANBROKEN = "1"
+
+PACKAGES += "guards guards-doc"
+FILES_${PN} = "${sysconfdir} ${datadir}/quilt \
+ ${bindir}/quilt ${libdir}/quilt"
+FILES_guards = "${bindir}/guards"
+FILES_${PN}-doc = "${mandir}/man1/quilt.1 ${docdir}/${BPN}"
+FILES_guards-doc = "${mandir}/man1/guards.1"
+
+RDEPENDS_${PN} = "bash"
+
+EXTRA_OE_MAKE_ARGS_darwin ?= ""
+EXTRA_OE_MAKE_ARGS ?= "BUILD_ROOT=${D}"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_BASH=/bin/bash"
+
+# quilt ignores DESTDIR
+do_install () {
+ oe_runmake ${EXTRA_OE_MAKE_ARGS} install
+ # cleanup unpackaged files
+ rm -rf ${D}/${datadir}/emacs
+}
+
+do_compile_ptest() {
+ oe_runmake bin/patch-wrapper test/.depend
+}
+
+do_install_ptest() {
+ tar -cf - bin/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ tar -cf - compat/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ tar -cf - quilt/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ tar -cf - test/ --exclude mail.test --exclude delete.test | ( cd ${D}${PTEST_PATH} && tar -xf - && chmod 777 test)
+ cp ${WORKDIR}/Makefile ${D}${PTEST_PATH}
+ cp ${WORKDIR}/test.sh ${D}${PTEST_PATH}
+}
+
+RDEPENDS_${PN}-ptest = "make file sed gawk diffutils findutils ed perl \
+ perl-module-filehandle perl-module-getopt-std \
+ perl-module-posix perl-module-file-temp \
+ perl-module-text-parsewords perl-module-overloading \
+ bash util-linux-getopt \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/Makefile b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/Makefile
new file mode 100644
index 000000000..7b3ac8a49
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/Makefile
@@ -0,0 +1,13 @@
+PATH := $(CURDIR)/bin:$(CURDIR)/compat:$(PATH)
+QUILT_DIR := $(CURDIR)/quilt
+QUILTRC := $(CURDIR)/test/test.quiltrc
+export QUILT_DIR QUILTRC
+CHECK_ENV := P=patches/; _P=../patches/; export P _P
+-include test/.depend
+
+check-% : test/%.test
+ @LANG=C; LC_ALL=C; \
+ export LANG LC_ALL; \
+ $(CHECK_ENV); \
+ cd $(<D); \
+ ./run -q $(<F)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/aclocal.patch b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/aclocal.patch
new file mode 100644
index 000000000..daf44295e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/aclocal.patch
@@ -0,0 +1,128 @@
+Upstream-Status: Pending
+
+Add the aclocal.m4 as acinclude.m4
+
+Index: quilt-0.47/acinclude.m4
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ quilt-0.47/acinclude.m4 2006-10-10 17:05:56.000000000 +0100
+@@ -0,0 +1,119 @@
++dnl Allow configure to specify a specific binary
++dnl 1: Environment variable
++dnl 2: binary name
++dnl 3: optional list of alternative binary names
++dnl 4: optional list of additional search directories
++AC_DEFUN([QUILT_COMPAT_PROG_PATH],[
++ m4_define([internal_$2_cmd],[esyscmd(ls compat/$2.in 2>/dev/null)])
++
++ AC_ARG_WITH($2, AC_HELP_STRING(
++ [--with-$2], [name of the $2 executable to use]
++ m4_if(internal_$2_cmd,[],[],[ (use --without-$2
++ to use an internal mechanism)])),
++ [
++ if test x"$withval" = xnone; then
++ AC_MSG_ERROR([Invalid configure argument. use --without-$2])
++ fi
++ if test x"$withval" != xno; then
++ AC_MSG_CHECKING(for $2)
++ $1="$withval"
++ if test -e "$$1"; then
++ if test ! -f "$$1" -a ! -h "$$1" || test ! -x "$$1"; then
++ AC_MSG_ERROR([$$1 is not an executable file])
++ fi
++ fi
++ AC_MSG_RESULT([$$1])
++ if test ! -e "$$1"; then
++ AC_MSG_WARN([$$1 does not exist])
++ fi
++ COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++ fi
++ ],[
++ m4_if([$3],[],[
++ AC_PATH_PROG($1,$2,,$PATH:$4)
++ ],[
++ AC_PATH_PROGS($1,$3,,$PATH:$4)
++ if test -n "$$1" -a "`expr "$$1" : '.*/\([[^/]]*\)$'`" != "$2"; then
++ COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++ fi
++ ])
++ m4_if([$4],[],[],[
++ if test -n "$$1"; then
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++ for dir in "$4"; do
++ if test "`dirname $$1`" = "$dir"; then
++ COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++ break
++ fi
++ done
++ IFS="$as_save_IFS"
++ fi
++ ])
++ ])
++ if test -z "$$1"; then
++ m4_if(internal_$2_cmd,[],[
++ AC_MSG_ERROR([Please specify the location of $2 with the option '--with-$2'])
++ ],[
++ AC_MSG_WARN([Using internal $2 mechanism. Use option '--with-$2' to override])
++ COMPAT_PROGRAMS="$COMPAT_PROGRAMS $2"
++ $1=$2
++ INTERNAL_$1=1
++ ])
++ fi
++ AC_SUBST($1)
++])
++
++dnl Allow configure to specify a specific binary
++dnl This variant is for optional binaries.
++dnl 1: Environment variable
++dnl 2: binary name
++dnl 3: optional list of alternative binary names
++dnl 4: optional list of additional search directories
++AC_DEFUN([QUILT_COMPAT_PROG_PATH_OPT],[
++ AC_ARG_WITH($2, AC_HELP_STRING(
++ [--with-$2], [name of the $2 executable to use]),
++ [
++ if test x"$withval" != xno; then
++ AC_MSG_CHECKING(for $2)
++ $1="$withval"
++ if test -e "$$1"; then
++ if test ! -f "$$1" -a ! -h "$$1" || test ! -x "$$1"; then
++ AC_MSG_ERROR([$$1 is not an executable file])
++ fi
++ fi
++ AC_MSG_RESULT([$$1])
++ if test ! -e "$$1"; then
++ AC_MSG_WARN([$$1 does not exist])
++ fi
++ COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++ fi
++ ],[
++ m4_if([$3],[],[
++ AC_PATH_PROG($1,$2,,$PATH:$4)
++ ],[
++ AC_PATH_PROGS($1,$3,,$PATH:$4)
++ if test -n "$$1" -a "`expr "$$1" : '.*/\([[^/]]*\)$'`" != "$2"; then
++ COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++ fi
++ ])
++ m4_if([$4],[],[],[
++ if test -n "$$1"; then
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++ for dir in "$4"; do
++ if test "`dirname $$1`" = "$dir"; then
++ COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++ break
++ fi
++ done
++ IFS="$as_save_IFS"
++ fi
++ ])
++ if test -z "$$1"; then
++ AC_MSG_WARN([$2 not found, some optional functionalities will be missing])
++ fi
++ ])
++ if test -z "$$1"; then
++ $1=$2
++ fi
++ AC_SUBST($1)
++])
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch
new file mode 100644
index 000000000..672155bb6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+the test should be skipped for cross compiling.
+
+Signed-off-by: Qing He <qing.he@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index 026a36c..8af591b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -245,6 +245,7 @@ fi
+ QUILT_COMPAT_PROG_PATH(DIFF, diff)
+ QUILT_COMPAT_PROG_PATH(PATCH, patch)
+
++if test "x$cross_compiling" != "xyes"; then
+ # Sun diff and others will not work because GNU patch options are used.
+ AC_MSG_CHECKING([the version of $DIFF])
+ if $DIFF --version 2>/dev/null | grep GNU >/dev/null; then
+@@ -293,6 +294,7 @@ current version of patch from ftp.gnu.org, or if you already have GNU patch
+ then you can supply its path with the '--with-patch=' option.
+ ])
+ fi
++fi
+
+ QUILT_COMPAT_PROG_PATH(FIND, find)
+
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
new file mode 100644
index 000000000..e2a7af655
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/install.patch
@@ -0,0 +1,13 @@
+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/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/run-ptest
new file mode 100755
index 000000000..4b808aee4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/run-ptest
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+THIS_SH=/bin/sh
+ln -sf /bin/ed /usr/bin/ed
+/usr/sbin/adduser --disabled-password quilttest
+su -c "${THIS_SH} ./test.sh" quilttest
+/usr/sbin/deluser quilttest
+rm -f /usr/bin/ed
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/test.sh b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/test.sh
new file mode 100755
index 000000000..6563e4a2f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt/test.sh
@@ -0,0 +1 @@
+for i in `ls test/*.test |awk -F. '{print $1}' |awk -F/ '{print $2}'`; do make check-$i; if [ $? -eq 0 ]; then echo PASS: $i.test; else echo FAIL: $i.test; fi; done
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
new file mode 100644
index 000000000..00f900a11
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/quilt/quilt_0.64.bb
@@ -0,0 +1,16 @@
+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/remake/remake.inc b/import-layers/yocto-poky/meta/recipes-devtools/remake/remake.inc
new file mode 100644
index 000000000..df889fcf9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/remake/remake.inc
@@ -0,0 +1,16 @@
+SUMMARY = "Makefile debugger which is gnumake compatible"
+DESCRIPTION = "remake is a patched and modernized version of GNU make \
+utility that adds improved error reporting, the ability to trace \
+execution in a comprehensible way, and a debugger."
+
+HOMEPAGE = "http://bashdb.sourceforge.net/remake/"
+SECTION = "devel"
+
+SRC_URI = "git://github.com/rocky/remake.git"
+
+inherit autotools gettext update-alternatives pkgconfig
+
+ALTERNATIVE_${PN} = "make"
+ALTERNATIVE_LINK_NAME[make] = "${bindir}/make"
+ALTERNATIVE_TARGET[make] = "${bindir}/remake"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/remake/remake/version-remake.texi.patch b/import-layers/yocto-poky/meta/recipes-devtools/remake/remake/version-remake.texi.patch
new file mode 100644
index 000000000..fa6329e06
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/remake/remake/version-remake.texi.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+version-remake.texi is not there but it is required by remake.texi,
+just add it for getting the 'make remake.info' works.
+
+==============================================================
+diff --git a/doc/version-remake.texi b/doc/version-remake.texi
+new file mode 100644
+index 0000000..2a3b72b
+--- /dev/null
++++ b/doc/version-remake.texi
+@@ -0,0 +1,4 @@
++@set UPDATED 10 June 2012
++@set UPDATED-MONTH June 2012
++@set EDITION 3.82+dbg-0.9git
++@set VERSION 3.82+dbg-0.9git
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/remake/remake_4.1+dbg-1.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/remake/remake_4.1+dbg-1.1.bb
new file mode 100644
index 000000000..8eab7e3a0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/remake/remake_4.1+dbg-1.1.bb
@@ -0,0 +1,28 @@
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://tests/COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://glob/COPYING.LIB;md5=4a770b67e6be0f60da244beb2de0fce4"
+require remake.inc
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+)\+dbg.+)"
+SRC_URI += "file://version-remake.texi.patch \
+ "
+SRCREV = "cf54641d50a0165bb17622b3e9770f426ccbc561"
+S = "${WORKDIR}/git"
+
+DEPENDS += "readline guile"
+# Need to add "gettext-native" dependency to remake-native.
+# By default only "gettext-minimal-native" is added
+# when inherit gettext.
+DEPENDS_class-native += "gettext-native"
+PROVIDES += "virtual/make"
+
+do_configure_prepend() {
+ # remove the default LINGUAS since we are not going to generate languages
+ rm ${S}/po/LINGUAS
+ touch ${S}/po/LINGUAS
+ # create config.rpath which required by configure.ac
+ ( cd ${S}; autopoint || touch config.rpath )
+}
+
+BBCLASSEXTEND = "native"
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
new file mode 100644
index 000000000..e9b73b8bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-Disable-__sync_add_and_fetch_8-on-nios2.patch
@@ -0,0 +1,30 @@
+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
new file mode 100644
index 000000000..c9fb26868
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-define-EM_AARCH64.patch
@@ -0,0 +1,35 @@
+[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-rpm-Fix-build-on-musl.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch
new file mode 100644
index 000000000..70dd4ff53
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch
@@ -0,0 +1,294 @@
+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-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
new file mode 100644
index 000000000..712825009
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch
@@ -0,0 +1,49 @@
+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
new file mode 100644
index 000000000..7894a4263
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/configure.ac-check-for-both-gpg2-and-gpg.patch
@@ -0,0 +1,29 @@
+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
new file mode 100644
index 000000000..1fdbf0908
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/dbconvert.patch
@@ -0,0 +1,27 @@
+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
new file mode 100644
index 000000000..c83c8b5f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch
@@ -0,0 +1,100 @@
+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
new file mode 100644
index 000000000..804048253
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch
@@ -0,0 +1,65 @@
+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/header-include-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/header-include-fix.patch
new file mode 100644
index 000000000..e72df45b5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/header-include-fix.patch
@@ -0,0 +1,36 @@
+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
new file mode 100644
index 000000000..5d936db5a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch
@@ -0,0 +1,33 @@
+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
new file mode 100644
index 000000000..410623fab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch
@@ -0,0 +1,14 @@
+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
new file mode 100755
index 000000000..b72c9f026
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh
@@ -0,0 +1,50 @@
+#!/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
new file mode 100644
index 000000000..bcad8dcb7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/popt-disable-auto-stack-protector.patch
@@ -0,0 +1,27 @@
+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
new file mode 100644
index 000000000..590f58d89
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch
@@ -0,0 +1,31 @@
+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
new file mode 100755
index 000000000..083b174f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/pythondeps.sh
@@ -0,0 +1,16 @@
+#!/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
new file mode 100644
index 000000000..cc241f4f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-atomic-ops.patch
@@ -0,0 +1,73 @@
+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
new file mode 100644
index 000000000..258a7f6e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen-force.patch
@@ -0,0 +1,78 @@
+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
new file mode 100644
index 000000000..8771235d3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch
@@ -0,0 +1,25 @@
+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
new file mode 100644
index 000000000..81fc84937
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch
@@ -0,0 +1,136 @@
+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
new file mode 100644
index 000000000..3d8d645a7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-check-rootpath-reasonableness.patch
@@ -0,0 +1,96 @@
+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
new file mode 100644
index 000000000..c86937653
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch
@@ -0,0 +1,19 @@
+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
new file mode 100644
index 000000000..5d08d279a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch
@@ -0,0 +1,174 @@
+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
new file mode 100644
index 000000000..b4df8b751
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db60.patch
@@ -0,0 +1,56 @@
+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
new file mode 100644
index 000000000..16b8e30a1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch
@@ -0,0 +1,77 @@
+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
new file mode 100644
index 000000000..2eb6e0f26
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
@@ -0,0 +1,65 @@
+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
new file mode 100644
index 000000000..124606c0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-auto-stack-protector.patch
@@ -0,0 +1,24 @@
+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
new file mode 100644
index 000000000..adbef6df8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-disable-blaketest.patch
@@ -0,0 +1,28 @@
+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-fileclass.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch
new file mode 100644
index 000000000..b1db6fff7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch
@@ -0,0 +1,36 @@
+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
new file mode 100644
index 000000000..290ec1aa1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch
@@ -0,0 +1,30 @@
+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
new file mode 100644
index 000000000..1a08243ab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-lua-tests-compilation-failure.patch
@@ -0,0 +1,43 @@
+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
new file mode 100644
index 000000000..c57f24cd7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-fix-parseEmbedded.patch
@@ -0,0 +1,27 @@
+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
new file mode 100644
index 000000000..36a418fc6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-gnu-atomic.patch
@@ -0,0 +1,64 @@
+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
new file mode 100644
index 000000000..057925fb6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch
@@ -0,0 +1,43 @@
+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
new file mode 100644
index 000000000..72884d4ad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-keccak-sse-intrin.patch
@@ -0,0 +1,27 @@
+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
new file mode 100644
index 000000000..1a48db63c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch
@@ -0,0 +1,52 @@
+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
new file mode 100644
index 000000000..e87e02b69
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch
@@ -0,0 +1,22 @@
+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
new file mode 100644
index 000000000..3153f7a38
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch
@@ -0,0 +1,15 @@
+
+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
new file mode 100644
index 000000000..a87518ba3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch
@@ -0,0 +1,24 @@
+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
new file mode 100644
index 000000000..a9930d670
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-lua.patch
@@ -0,0 +1,33 @@
+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
new file mode 100644
index 000000000..a08412aa9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.in-disable-external-key-server.patch
@@ -0,0 +1,31 @@
+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
new file mode 100644
index 000000000..c7ab2d2bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-macros.patch
@@ -0,0 +1,64 @@
+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
new file mode 100644
index 000000000..6c3e4718b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-mongodb-sasl.patch
@@ -0,0 +1,69 @@
+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
new file mode 100644
index 000000000..e58cc13a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch
@@ -0,0 +1,19 @@
+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
new file mode 100644
index 000000000..58182296c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch
@@ -0,0 +1,47 @@
+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
new file mode 100644
index 000000000..e2191245f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch
@@ -0,0 +1,24 @@
+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
new file mode 100644
index 000000000..691aba9ea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 000000000..57fc6ce88
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
@@ -0,0 +1,25 @@
+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
new file mode 100644
index 000000000..af643b1c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch
@@ -0,0 +1,126 @@
+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
new file mode 100644
index 000000000..656de86d7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch
@@ -0,0 +1,37 @@
+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
new file mode 100644
index 000000000..200964f39
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch
@@ -0,0 +1,28 @@
+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
new file mode 100644
index 000000000..3b40fea0e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
@@ -0,0 +1,137 @@
+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
new file mode 100644
index 000000000..b9675c71b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
@@ -0,0 +1,105 @@
+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
new file mode 100644
index 000000000..92ef1dc50
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch
@@ -0,0 +1,29 @@
+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
new file mode 100644
index 000000000..df6f4722e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-AddErase.patch
@@ -0,0 +1,35 @@
+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
new file mode 100644
index 000000000..7a473db1a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-restore-origin.patch
@@ -0,0 +1,49 @@
+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
new file mode 100644
index 000000000..dfb551377
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-python-tagname.patch
@@ -0,0 +1,24 @@
+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
new file mode 100644
index 000000000..a810123ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch
@@ -0,0 +1,24 @@
+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
new file mode 100644
index 000000000..59fe524df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch
@@ -0,0 +1,31 @@
+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
new file mode 100644
index 000000000..526106d1e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch
@@ -0,0 +1,40 @@
+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
new file mode 100644
index 000000000..71dae4939
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmdb-grammar.patch
@@ -0,0 +1,124 @@
+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
new file mode 100644
index 000000000..b9a2cbce2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmfc.c-fix-for-N32-MIPS64.patch
@@ -0,0 +1,34 @@
+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
new file mode 100644
index 000000000..93645766c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmio-headers.patch
@@ -0,0 +1,19 @@
+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
new file mode 100644
index 000000000..915d7efe6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-popt.patch
@@ -0,0 +1,26 @@
+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
new file mode 100644
index 000000000..b55fe22c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch
@@ -0,0 +1,159 @@
+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
new file mode 100644
index 000000000..ec38b95f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch
@@ -0,0 +1,26 @@
+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
new file mode 100644
index 000000000..d6493c197
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-syck-fix-gram.patch
@@ -0,0 +1,1081 @@
+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
new file mode 100644
index 000000000..5fb40b6fe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch
@@ -0,0 +1,50 @@
+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
new file mode 100644
index 000000000..9eb675ba2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tagname-type.patch
@@ -0,0 +1,25 @@
+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
new file mode 100644
index 000000000..72d350929
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch
@@ -0,0 +1,24 @@
+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
new file mode 100644
index 000000000..713f84ee2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch
@@ -0,0 +1,40 @@
+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
new file mode 100755
index 000000000..6bcef6a4c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpm2cpio
@@ -0,0 +1,39 @@
+#!/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
new file mode 100644
index 000000000..9bbf580e4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmatch.patch
@@ -0,0 +1,34 @@
+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
new file mode 100644
index 000000000..809e54e9c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdb-more-verbose-error-logging-in-rpmTempFile.patch
@@ -0,0 +1,53 @@
+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 dce6c4e..a1d0f06 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) {
++ rpmlog(RPMLOG_ERR, _("error creating temporary directory %s: %d\n"), tempfn, ret);
++ goto errxit;
++ }
+ }
+
+ /* XXX should probably use mkstemp here */
+@@ -68,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/rpmdeps-oecore.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch
new file mode 100644
index 000000000..9bdd1d490
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch
@@ -0,0 +1,194 @@
+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
new file mode 100644
index 000000000..c68681c1e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv.c-check-_gpg_passphrase-before-ask-for-input.patch
@@ -0,0 +1,70 @@
+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
new file mode 100644
index 000000000..b2437a872
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch
@@ -0,0 +1,50 @@
+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
new file mode 100644
index 000000000..dc7b0488a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/uclibc-support.patch
@@ -0,0 +1,63 @@
+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+cvs.bb b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
new file mode 100644
index 000000000..0991f6d52
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
@@ -0,0 +1,730 @@
+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"
+
+# Apply various fixups that are unique to the CVS environment
+do_fixup_unpack () {
+ # 'ln' isn't reliable, and 'mv' could break later builds
+ rm -rf ${S}/syck ; cp -r ${WORKDIR}/syck ${S}/.
+ rm -rf ${S}/lua ; cp -r ${WORKDIR}/lua ${S}/.
+ rm -rf ${S}/popt ; cp -r ${WORKDIR}/popt ${S}/.
+ rm -rf ${S}/beecrypt ; cp -r ${WORKDIR}/beecrypt ${S}/.
+}
+
+addtask fixup_unpack after do_unpack before do_patch
+
+# This recipe is really designed for development... to Try out the latest
+# community work in progress.
+DEFAULT_PREFERENCE = "-1"
+
+S = "${WORKDIR}/rpm"
+
+# 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...
+SRC_URI = "cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=rpm \
+ cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=syck \
+ cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=lua \
+ cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=popt \
+ cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=beecrypt \
+ file://perfile_rpmdeps.sh \
+ file://pythondeps.sh \
+"
+
+# 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://0001-Disable-__sync_add_and_fetch_8-on-nios2.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 \
+"
+
+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"
+
+inherit autotools gettext
+
+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=${libdir}/python${PYTHON_BASEVERSION}/site-packages \
+ --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 \
+ --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"
+
+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 \
+ ${bindir}/rpm2cpio.real \
+ "
+
+FILES_${PN}-common = "${bindir}/rpm2cpio \
+ ${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 = "${libdir}/python*/site-packages/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 \
+ "
+
+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 \
+ ${libdir}/python*/site-packages/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* ; make distclean ) || :
+
+ 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
+
+ # Remove unpackaged files (based on list in rpm.spec)
+ rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
+
+ rm -f ${D}/${mandir}/man8/rpmcache.8*
+ rm -f ${D}/${mandir}/man8/rpmgraph.8*
+ rm -f ${D}/${mandir}/*/man8/rpmcache.8*
+ rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
+ rm -rf ${D}/${mandir}/{fr,ko}
+
+ 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}/${mandir}/man1/xar.1*
+ rm -f ${D}/${bindir}/xar
+ rm -rf ${D}/${includedir}/xar
+ rm -f ${D}/${libdir}/libxar*
+
+ rm -f ${D}/${bindir}/lz*
+ rm -f ${D}/${bindir}/unlzma
+ rm -f ${D}/${bindir}/unxz
+ rm -f ${D}/${bindir}/xz*
+ rm -rf ${D}/${includedir}/lzma*
+ rm -f ${D}/${mandir}/man1/lz*.1
+ rm -f ${D}/${libdir}/pkgconfig/liblzma*
+
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.a
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.la
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.a
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.la
+
+ #find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \
+ # -o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';'
+ #find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';'
+
+ rm -f ${D}/${libdir}/rpm/dbconvert.sh
+
+ rm -f ${D}/${libdir}/rpm/libsqldb.*
+
+ # We don't want, nor need the Mandriva multiarch items
+ rm -f ${D}/${bindir}/multiarch-dispatch
+ rm -f ${D}/${bindir}/multiarch-platform
+ rm -f ${D}/${libdir}/rpm/check-multiarch-files
+ rm -f ${D}/${libdir}/rpm/mkmultiarch
+ rm -f ${D}/${includedir}/multiarch-dispatch.h
+
+ 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/dbconvert
+ 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}/${libdir}/python2.7/site-packages/rpm/transaction.py
+}
+
+do_install_append_class-nativesdk () {
+ sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env python|' ${D}/${libdir}/python2.7/site-packages/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_5.4.16.bb b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb
new file mode 100644
index 000000000..f2c12d2de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb
@@ -0,0 +1,740 @@
+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 \
+"
+
+# 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-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
+
+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=${libdir}/python${PYTHON_BASEVERSION}/site-packages \
+ --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"
+
+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 \
+ ${bindir}/rpm2cpio.real \
+ "
+
+FILES_${PN}-common = "${bindir}/rpm2cpio \
+ ${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 = "${libdir}/python*/site-packages/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 \
+ ${libdir}/python*/site-packages/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* ; make distclean ) || :
+
+ 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
+
+ # Remove unpackaged files (based on list in rpm.spec)
+ rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
+
+ rm -f ${D}/${mandir}/man8/rpmcache.8*
+ rm -f ${D}/${mandir}/man8/rpmgraph.8*
+ rm -f ${D}/${mandir}/*/man8/rpmcache.8*
+ rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
+ rm -rf ${D}/${mandir}/{fr,ko}
+
+ 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}/${mandir}/man1/xar.1*
+ rm -f ${D}/${bindir}/xar
+ rm -rf ${D}/${includedir}/xar
+ rm -f ${D}/${libdir}/libxar*
+
+ rm -f ${D}/${bindir}/lz*
+ rm -f ${D}/${bindir}/unlzma
+ rm -f ${D}/${bindir}/unxz
+ rm -f ${D}/${bindir}/xz*
+ rm -rf ${D}/${includedir}/lzma*
+ rm -f ${D}/${mandir}/man1/lz*.1
+ rm -f ${D}/${libdir}/pkgconfig/liblzma*
+
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.a
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.la
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.a
+ rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.la
+
+ #find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \
+ # -o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';'
+ #find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';'
+
+ rm -f ${D}/${libdir}/rpm/dbconvert.sh
+
+ rm -f ${D}/${libdir}/rpm/libsqldb.*
+
+ # We don't want, nor need the Mandriva multiarch items
+ rm -f ${D}/${bindir}/multiarch-dispatch
+ rm -f ${D}/${bindir}/multiarch-platform
+ rm -f ${D}/${libdir}/rpm/check-multiarch-files
+ rm -f ${D}/${libdir}/rpm/mkmultiarch
+ rm -f ${D}/${includedir}/multiarch-dispatch.h
+
+ 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/dbconvert
+ 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}/${libdir}/python2.7/site-packages/rpm/transaction.py
+}
+
+do_install_append_class-nativesdk () {
+ sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env python|' ${D}/${libdir}/python2.7/site-packages/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/rpmresolve/rpmresolve.c b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c
new file mode 100644
index 000000000..c0b4d567f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c
@@ -0,0 +1,426 @@
+/* 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
new file mode 100644
index 000000000..0c13a6710
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpmresolve_1.0.bb
@@ -0,0 +1,29 @@
+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/files/makefile-no-rebuild.patch b/import-layers/yocto-poky/meta/recipes-devtools/rsync/files/makefile-no-rebuild.patch
new file mode 100644
index 000000000..3d27fe72c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/files/makefile-no-rebuild.patch
@@ -0,0 +1,69 @@
+Remove the Makefile rules to reinvoke autoconf, they're not out-of-tree safe and
+generally overcomplicated, and we ensure that autoreconf is invoked if required.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/Makefile.in b/Makefile.in
+index 151247d..8f3fdb6 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -141,58 +141,6 @@ gen: conf proto.h man
+ gensend: gen
+ rsync -aivzc $(GENFILES) $${SAMBA_HOST-samba.org}:/home/ftp/pub/rsync/generated-files/
+
+-conf:
+- cd $(srcdir) && $(MAKE) -f prepare-source.mak conf
+-
+-aclocal.m4: $(srcdir)/m4/*.m4
+- aclocal -I $(srcdir)/m4
+-
+-configure.sh config.h.in: configure.ac aclocal.m4
+- @if test -f configure.sh; then cp -p configure.sh configure.sh.old; else touch configure.sh.old; fi
+- @if test -f config.h.in; then cp -p config.h.in config.h.in.old; else touch config.h.in.old; fi
+- autoconf -o configure.sh
+- autoheader && touch config.h.in
+- @if diff configure.sh configure.sh.old >/dev/null 2>&1; then \
+- echo "configure.sh is unchanged."; \
+- rm configure.sh.old; \
+- else \
+- echo "configure.sh has CHANGED."; \
+- fi
+- @if diff config.h.in config.h.in.old >/dev/null 2>&1; then \
+- echo "config.h.in is unchanged."; \
+- rm config.h.in.old; \
+- else \
+- echo "config.h.in has CHANGED."; \
+- fi
+- @if test -f configure.sh.old -o -f config.h.in.old; then \
+- if test "$(MAKECMDGOALS)" = reconfigure; then \
+- echo 'Continuing with "make reconfigure".'; \
+- else \
+- echo 'You may need to run:'; \
+- echo ' make reconfigure'; \
+- exit 1; \
+- fi \
+- fi
+-
+-reconfigure: configure.sh
+- ./config.status --recheck
+- ./config.status
+-
+-Makefile: Makefile.in config.status configure.sh config.h.in
+- @if test -f Makefile; then cp -p Makefile Makefile.old; else touch Makefile.old; fi
+- @./config.status
+- @if diff Makefile Makefile.old >/dev/null 2>&1; then \
+- echo "Makefile is unchanged."; \
+- rm Makefile.old; \
+- else \
+- if test "$(MAKECMDGOALS)" = reconfigure; then \
+- echo 'Continuing with "make reconfigure".'; \
+- else \
+- echo "Makefile updated -- rerun your make command."; \
+- exit 1; \
+- fi \
+- fi
+-
+ rsync-ssl: $(srcdir)/rsync-ssl.in Makefile
+ sed 's;\@bindir\@;$(bindir);g' <$(srcdir)/rsync-ssl.in >rsync-ssl
+ @chmod +x rsync-ssl
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rsync/files/rsyncd.conf b/import-layers/yocto-poky/meta/recipes-devtools/rsync/files/rsyncd.conf
new file mode 100644
index 000000000..845f5b33f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/files/rsyncd.conf
@@ -0,0 +1,15 @@
+# /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-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
new file mode 100644
index 000000000..bea325ea0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsync-2.6.9-fname-obo.patch
@@ -0,0 +1,71 @@
+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
new file mode 100644
index 000000000..845f5b33f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf
@@ -0,0 +1,15 @@
+# /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
new file mode 100644
index 000000000..c65f27031
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync.inc
@@ -0,0 +1,23 @@
+SUMMARY = "File synchronization tool"
+HOMEPAGE = "http://rsync.samba.org/"
+BUGTRACKER = "http://rsync.samba.org/bugzilla.html"
+SECTION = "console/network"
+
+# GPLv2+ (<< 3.0.0), GPLv3+ (>= 3.0.0)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+# needs to add acl and attr
+DEPENDS = "popt"
+
+SRC_URI = "http://rsync.samba.org/ftp/rsync/src/rsync-${PV}.tar.gz \
+ file://rsyncd.conf"
+
+inherit autotools
+
+do_install_append() {
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/rsyncd.conf ${D}${sysconfdir}
+}
+
+EXTRA_OEMAKE='STRIP=""'
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
new file mode 100644
index 000000000..6854c77f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_2.6.9.bb
@@ -0,0 +1,28 @@
+SUMMARY = "File synchronization tool"
+HOMEPAGE = "http://rsync.samba.org/"
+BUGTRACKER = "http://rsync.samba.org/bugzilla.html"
+SECTION = "console/network"
+
+# needs to add acl and attr
+DEPENDS = "popt"
+
+SRC_URI = "http://rsync.samba.org/ftp/rsync/src/rsync-${PV}.tar.gz \
+ file://rsync-2.6.9-fname-obo.patch \
+ file://rsyncd.conf"
+
+SRC_URI[md5sum] = "996d8d8831dbca17910094e56dcb5942"
+SRC_URI[sha256sum] = "ca437301becd890e73300bc69a39189ff1564baa761948ff149b3dd7bde633f9"
+
+inherit autotools
+
+do_install_append() {
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/rsyncd.conf ${D}${sysconfdir}
+}
+
+EXTRA_OEMAKE='STRIP=""'
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6d5a9d4c4d3af25cd68fd83e8a8cb09c"
+
+PR = "r4"
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
new file mode 100644
index 000000000..9637ed4e7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rsync/rsync_3.1.2.bb
@@ -0,0 +1,26 @@
+require rsync.inc
+
+SRC_URI += "file://makefile-no-rebuild.patch"
+
+SRC_URI[md5sum] = "0f758d7e000c0f7f7d3792610fad70cb"
+SRC_URI[sha256sum] = "ecfa62a7fa3c4c18b9eccd8c16eaddee4bd308a76ea50b5c02a5840f09c0a1c2"
+
+PACKAGECONFIG ??= "acl attr"
+PACKAGECONFIG[acl] = "--enable-acl-support,--disable-acl-support,acl,"
+PACKAGECONFIG[attr] = "--enable-xattr-support,--disable-xattr-support,attr,"
+
+# By default, if crosscompiling, rsync disables a number of
+# capabilities, hardlinking symlinks and special files (i.e. devices)
+CACHED_CONFIGUREVARS += "rsync_cv_can_hardlink_special=yes rsync_cv_can_hardlink_symlink=yes"
+
+# rsync 3.0 uses configure.sh instead of configure, and
+# makefile checks the existence of configure.sh
+do_configure_prepend () {
+ rm -f ${S}/configure ${S}/configure.sh
+}
+
+do_configure_append () {
+ cp -f ${S}/configure ${S}/configure.sh
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby.inc b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby.inc
new file mode 100644
index 000000000..313e75222
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby.inc
@@ -0,0 +1,38 @@
+SUMMARY = "An interpreter of object-oriented scripting language"
+DESCRIPTION = "Ruby is an interpreted scripting language for quick \
+and easy object-oriented programming. It has many features to process \
+text files and to do system management tasks (as in Perl). \
+It is simple, straight-forward, and extensible. \
+"
+HOMEPAGE = "http://www.ruby-lang.org/"
+SECTION = "devel/ruby"
+LICENSE = "Ruby | BSD | GPLv2"
+LIC_FILES_CHKSUM = "\
+ file://COPYING;md5=837b32593517ae48b9c3b5c87a5d288c \
+ file://BSDL;md5=19aaf65c88a40b508d17ae4be539c4b5\
+ file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263\
+ file://LEGAL;md5=c440adb575ba4e6e2344c2630b6a5584\
+"
+
+DEPENDS = "ruby-native zlib openssl tcl libyaml db gdbm readline"
+DEPENDS_class-native = "openssl-native libyaml-native"
+
+SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+SRC_URI = "http://cache.ruby-lang.org/pub/ruby/${SHRT_VER}/ruby-${PV}.tar.gz \
+ file://extmk.patch \
+"
+
+inherit autotools
+
+
+# This snippet lets compiled extensions which rely on external libraries,
+# such as zlib, compile properly. If we don't do this, then when extmk.rb
+# runs, it uses the native libraries instead of the target libraries, and so
+# none of the linking operations succeed -- which makes extconf.rb think
+# that the libraries aren't available and hence that the extension can't be
+# built.
+
+do_configure_prepend() {
+ sed -i "s#%%TARGET_CFLAGS%%#$TARGET_CFLAGS#; s#%%TARGET_LDFLAGS%%#$TARGET_LDFLAGS#" ${S}/common.mk
+ rm -rf ${S}/ruby/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/extmk.patch b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/extmk.patch
new file mode 100644
index 000000000..8b6845034
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby/extmk.patch
@@ -0,0 +1,13 @@
+diff -ru ruby-1.8.7-p248.orig/ext/extmk.rb ruby-1.8.7-p248/ext/extmk.rb
+--- ruby-1.8.7-p248.orig/ext/extmk.rb 2009-12-24 03:01:58.000000000 -0600
++++ ruby-1.8.7-p248/ext/extmk.rb 2010-02-12 15:55:27.370061558 -0600
+@@ -354,8 +354,8 @@
+ $ruby = '$(topdir)/miniruby' + EXEEXT
+ end
+ $ruby << " -I'$(topdir)'"
++$ruby << " -I'$(top_srcdir)/lib'"
+ unless CROSS_COMPILING
+- $ruby << " -I'$(top_srcdir)/lib'"
+ $ruby << " -I'$(extout)/$(arch)' -I'$(extout)/common'" if $extout
+ $ruby << " -I./- -I'$(top_srcdir)/ext' -rpurelib.rb"
+ ENV["RUBYLIB"] = "-"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.2.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.2.2.bb
new file mode 100644
index 000000000..671502356
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/ruby/ruby_2.2.2.bb
@@ -0,0 +1,46 @@
+require ruby.inc
+
+SRC_URI[md5sum] = "326e99ddc75381c7b50c85f7089f3260"
+SRC_URI[sha256sum] = "5ffc0f317e429e6b29d4a98ac521c3ce65481bfd22a8cf845fa02a7b113d9b44"
+
+# 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 \
+"
+
+EXTRA_OEMAKE = " \
+ LIBRUBYARG='-lruby-static' \
+"
+
+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
new file mode 100755
index 000000000..53a8e1db0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
@@ -0,0 +1,92 @@
+#!/bin/sh
+#
+# Copyright 2007 Openedhand Ltd.
+#
+# Author: Richard Purdie <rpurdie@openedhand.com>
+#
+
+# The following script will run all the scriptlets found in #SYSCONFDIR#/deb-postinsts,
+# #SYSCONFDIR#/ipk-postinsts or #SYSCONFDIR#/rpm-posinsts.
+
+# the order of this list is important, do not change!
+backend_list="rpm deb ipk"
+
+pm_installed=false
+
+for pm in $backend_list; do
+ pi_dir="#SYSCONFDIR#/$pm-postinsts"
+
+ [ -d $pi_dir ] && break
+
+ case $pm in
+ "deb")
+ if [ -s "#LOCALSTATEDIR#/lib/dpkg/status" ]; then
+ pm_installed=true
+ break
+ fi
+ ;;
+
+ "ipk")
+ if [ -s "/var/lib/opkg/status" ]; then
+ pm_installed=true
+ break
+ fi
+ ;;
+ esac
+done
+
+remove_rcsd_link () {
+ if [ -n "`which update-rc.d`" ]; then
+ update-rc.d -f run-postinsts remove
+ fi
+}
+
+if [ -z "$pi_dir" ]; then
+ remove_rcsd_link
+ exit 0
+fi
+
+[ -e #SYSCONFDIR#/default/postinst ] && . #SYSCONFDIR#/default/postinst
+
+if [ "$POSTINST_LOGGING" = "1" ]; then
+ rm -f $LOGFILE
+ append_log=">>$LOGFILE 2>&1"
+fi
+
+exec_postinst_scriptlets() {
+ for i in `ls $pi_dir`; do
+ i=$pi_dir/$i
+ echo "Running postinst $i..."
+ [ "$POSTINST_LOGGING" = "1" ] && eval echo "Running postinst $i..." $append_log
+ if [ -x $i ]; then
+ eval sh -c $i $append_log
+ rm $i
+ else
+ echo "ERROR: postinst $i failed."
+ [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log
+ remove_pi_dir=0
+ fi
+ done
+}
+
+remove_pi_dir=1
+if $pm_installed; then
+ case $pm in
+ "ipk")
+ eval opkg configure $append_log
+ ;;
+
+ "deb")
+ eval dpkg --configure -a $append_log
+ ;;
+ esac
+else
+ exec_postinst_scriptlets
+fi
+
+# since all postinstalls executed successfully, remove the postinstalls directory
+# and the rcS.d link
+if [ $remove_pi_dir = 1 ]; then
+ rm -rf $pi_dir
+ remove_rcsd_link
+fi
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init
new file mode 100644
index 000000000..473a1f7f6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+run-postinsts
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service
new file mode 100644
index 000000000..85a043949
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Run pending postinsts
+DefaultDependencies=no
+After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
+Before=sysinit.target
+ConditionPathExistsGlob=#SYSCONFDIR#/*-postinsts
+
+[Service]
+Type=oneshot
+ExecStart=#SBINDIR#/run-postinsts
+ExecStartPost=#BASE_BINDIR#/systemctl disable run-postinsts.service
+RemainAfterExit=No
+TimeoutSec=0
+
+[Install]
+WantedBy=sysinit.target
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
new file mode 100644
index 000000000..11c94e57d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Runs postinstall scripts on first boot of the target device"
+SECTION = "devel"
+PR = "r9"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://run-postinsts \
+ file://run-postinsts.init \
+ file://run-postinsts.service"
+
+S = "${WORKDIR}"
+
+inherit allarch systemd update-rc.d
+
+INITSCRIPT_NAME = "run-postinsts"
+INITSCRIPT_PARAMS = "start 99 S ."
+
+SYSTEMD_SERVICE_${PN} = "run-postinsts.service"
+
+do_configure() {
+ :
+}
+
+do_compile () {
+ :
+}
+
+do_install() {
+ install -d ${D}${sbindir}
+ install -m 0755 ${WORKDIR}/run-postinsts ${D}${sbindir}/
+
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/run-postinsts.init ${D}${sysconfdir}/init.d/run-postinsts
+
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/run-postinsts.service ${D}${systemd_unitdir}/system/
+
+ sed -i -e 's:#SYSCONFDIR#:${sysconfdir}:g' \
+ -e 's:#SBINDIR#:${sbindir}:g' \
+ -e 's:#BASE_BINDIR#:${base_bindir}:g' \
+ -e 's:#LOCALSTATEDIR#:${localstatedir}:g' \
+ ${D}${sbindir}/run-postinsts \
+ ${D}${systemd_unitdir}/system/run-postinsts.service
+}
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
new file mode 100644
index 000000000..1f39b0330
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/autohell.patch
@@ -0,0 +1,61 @@
+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
new file mode 100644
index 000000000..54b3f5449
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/license.patch
@@ -0,0 +1,29 @@
+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
new file mode 100644
index 000000000..597536570
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb
@@ -0,0 +1,71 @@
+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"
+CLEANFUNCS += "sgml_common_sstate_clean"
+
+
+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
+ fi
+}
+
+sgml_common_sstate_clean () {
+ # 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
+}
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
new file mode 100644
index 000000000..6098673a3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb
@@ -0,0 +1,68 @@
+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 = "ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES/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
new file mode 100644
index 000000000..01581c14c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/sgmlspl/sgmlspl-native_git.bb
@@ -0,0 +1,21 @@
+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/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch b/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch
new file mode 100644
index 000000000..a5bab0544
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch
@@ -0,0 +1,154 @@
+From ac6268e843c43286eebff2a1052182c2393cdb2e Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Mon, 14 Sep 2015 12:31:42 +0800
+Subject: [PATCH] mksquashfs.c: get inline functions work with both gnu11 and gnu89
+
+Upstream-Status: Pending
+
+After gcc upgraded to gcc5, and if the codes is compiled without optimization(-O0),
+and the below error will happen:
+
+| mksquashfs.o: In function `create_inode':
+| git/squashfs-tools/mksquashfs.c:897: undefined reference to `get_inode_no'
+| git/squashfs-tools/mksquashfs.c:960: undefined reference to `get_parent_no'
+| git/squashfs-tools/mksquashfs.c:983: undefined reference to `get_parent_no'
+| mksquashfs.o: In function `reader_read_process':
+| git/squashfs-tools/mksquashfs.c:2132: undefined reference to `is_fragment'
+| mksquashfs.o: In function `reader_read_file':
+| git/squashfs-tools/mksquashfs.c:2228: undefined reference to `is_fragment'
+| mksquashfs.o: In function `dir_scan':
+| git/squashfs-tools/mksquashfs.c:3101: undefined reference to `create_dir_entry'
+
+gcc5 defaults to -std=gnu11 instead of -std=gnu89, and it requires that exactly one C
+source file has the callable copy of the inline function. Consider the following
+program:
+
+ inline int
+ foo (void)
+ {
+ return 42;
+ }
+
+ int
+ main (void)
+ {
+ return foo ();
+ }
+
+The program above will not link with the C99 inline semantics, because no out-of-line
+function foo is generated. To fix this, either mark the function foo as static, or
+add the following declaration:
+ static inline int foo (void);
+
+more information refer to: https://gcc.gnu.org/gcc-5/porting_to.html;
+
+but the use of "extern inline" will lead to the compilation issue if gcc is not
+gcc5, as the commit in oe-core d0af30c92fde [alsa-lib: Change function type to
+"static __inline__"]
+ "extern __inline__ function()" is the inlined version that
+ can be used in this compilation unit, but there will be another
+ definition of this function somewhere, so compiler will not emit
+ any code for the function body. This causes problem in -O0,
+ where functions are never inlined, the function call is preserved,
+ but linker can't find the symbol, thus the error happens.
+
+so replace "inline" with "static inline" to make it work with both gnu11 and gnu89
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ squashfs-tools/mksquashfs.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+index d221c35..6bba1d2 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -828,13 +828,13 @@ char *subpathname(struct dir_ent *dir_ent)
+ }
+
+
+-inline unsigned int get_inode_no(struct inode_info *inode)
++static inline unsigned int get_inode_no(struct inode_info *inode)
+ {
+ return inode->inode_number;
+ }
+
+
+-inline unsigned int get_parent_no(struct dir_info *dir)
++static inline unsigned int get_parent_no(struct dir_info *dir)
+ {
+ return dir->depth ? get_inode_no(dir->dir_ent->inode) : inode_no;
+ }
+@@ -2027,7 +2027,7 @@ struct file_info *duplicate(long long file_size, long long bytes,
+ }
+
+
+-inline int is_fragment(struct inode_info *inode)
++static inline int is_fragment(struct inode_info *inode)
+ {
+ off_t file_size = inode->buf.st_size;
+
+@@ -2996,13 +2996,13 @@ struct inode_info *lookup_inode2(struct stat *buf, int pseudo, int id)
+ }
+
+
+-inline struct inode_info *lookup_inode(struct stat *buf)
++static inline struct inode_info *lookup_inode(struct stat *buf)
+ {
+ return lookup_inode2(buf, 0, 0);
+ }
+
+
+-inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this)
++static inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this)
+ {
+ if (inode->inode_number == 0) {
+ inode->inode_number = use_this ? : inode_no ++;
+@@ -3013,7 +3013,7 @@ inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this)
+ }
+
+
+-inline struct dir_ent *create_dir_entry(char *name, char *source_name,
++static inline struct dir_ent *create_dir_entry(char *name, char *source_name,
+ char *nonstandard_pathname, struct dir_info *dir)
+ {
+ struct dir_ent *dir_ent = malloc(sizeof(struct dir_ent));
+@@ -3031,7 +3031,7 @@ inline struct dir_ent *create_dir_entry(char *name, char *source_name,
+ }
+
+
+-inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir,
++static inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir,
+ struct inode_info *inode_info)
+ {
+ struct dir_info *dir = dir_ent->our_dir;
+@@ -3047,7 +3047,7 @@ inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir,
+ }
+
+
+-inline void add_dir_entry2(char *name, char *source_name,
++static inline void add_dir_entry2(char *name, char *source_name,
+ char *nonstandard_pathname, struct dir_info *sub_dir,
+ struct inode_info *inode_info, struct dir_info *dir)
+ {
+@@ -3059,7 +3059,7 @@ inline void add_dir_entry2(char *name, char *source_name,
+ }
+
+
+-inline void free_dir_entry(struct dir_ent *dir_ent)
++static inline void free_dir_entry(struct dir_ent *dir_ent)
+ {
+ if(dir_ent->name)
+ free(dir_ent->name);
+@@ -3080,7 +3080,7 @@ inline void free_dir_entry(struct dir_ent *dir_ent)
+ }
+
+
+-inline void add_excluded(struct dir_info *dir)
++static inline void add_excluded(struct dir_info *dir)
+ {
+ dir->excluded ++;
+ }
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch b/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch
new file mode 100644
index 000000000..d54514691
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch
@@ -0,0 +1,63 @@
+Define FNM_EXTMATCH if not defined its glibc specific define
+include missing sys/stat.h for stat* function declarations
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: squashfs-tools/action.c
+===================================================================
+--- squashfs-tools.orig/action.c
++++ squashfs-tools/action.c
+@@ -44,6 +44,10 @@
+ #include "action.h"
+ #include "error.h"
+
++#if !defined(FNM_EXTMATCH)
++#define FNM_EXTMATCH 0
++#endif
++
+ /*
+ * code to parse actions
+ */
+Index: squashfs-tools/mksquashfs.c
+===================================================================
+--- squashfs-tools.orig/mksquashfs.c
++++ squashfs-tools/mksquashfs.c
+@@ -1286,6 +1286,10 @@ void write_dir(squashfs_inode *inode, st
+ dir_size + 3, directory_block, directory_offset, NULL, NULL,
+ dir, 0);
+
++#if !defined(FNM_EXTMATCH)
++#define FNM_EXTMATCH 0
++#endif
++
+ #ifdef SQUASHFS_TRACE
+ {
+ unsigned char *dirp;
+Index: squashfs-tools/pseudo.c
+===================================================================
+--- squashfs-tools.orig/pseudo.c
++++ squashfs-tools/pseudo.c
+@@ -32,6 +32,7 @@
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
++#include <sys/stat.h>
+ #include <ctype.h>
+
+ #include "pseudo.h"
+Index: squashfs-tools/unsquashfs.c
+===================================================================
+--- squashfs-tools.orig/unsquashfs.c
++++ squashfs-tools/unsquashfs.c
+@@ -38,6 +38,10 @@
+ #include <limits.h>
+ #include <ctype.h>
+
++#ifndef FNM_EXTMATCH
++#define FNM_EXTMATCH 0
++#endif
++
+ struct cache *fragment_cache, *data_cache;
+ struct queue *to_reader, *to_inflate, *to_writer, *from_writer;
+ pthread_t *thread, *inflator_thread;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
new file mode 100644
index 000000000..33ed09ae8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
@@ -0,0 +1,39 @@
+# Note, we can probably remove the lzma option as it has be replaced with xz,
+# and I don't think the kernel supports it any more.
+SUMMARY = "Tools for manipulating SquashFS filesystems"
+SECTION = "base"
+LICENSE = "GPL-2 & PD"
+LIC_FILES_CHKSUM = "file://../COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://../../7zC.txt;beginline=12;endline=16;md5=2056cd6d919ebc3807602143c7449a7c \
+"
+DEPENDS = "attr zlib xz lzo lz4"
+
+PV = "4.3+gitr${SRCPV}"
+SRCREV = "9c1db6d13a51a2e009f0027ef336ce03624eac0d"
+SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \
+ http://downloads.sourceforge.net/sevenzip/lzma465.tar.bz2;name=lzma \
+ file://0001-mksquashfs.c-get-inline-functions-work-with-C99.patch;striplevel=2 \
+ file://fix-compat.patch \
+"
+SRC_URI[lzma.md5sum] = "29d5ffd03a5a3e51aef6a74e9eafb759"
+SRC_URI[lzma.sha256sum] = "c935fd04dd8e0e8c688a3078f3675d699679a90be81c12686837e0880aa0fa1e"
+
+S = "${WORKDIR}/git/squashfs-tools"
+
+# EXTRA_OEMAKE is typically: -e MAKEFLAGS=
+# the -e causes problems as CFLAGS is modified in the Makefile, so
+# we redefine EXTRA_OEMAKE here
+EXTRA_OEMAKE = "MAKEFLAGS= LZMA_SUPPORT=1 LZMA_DIR=../.. XZ_SUPPORT=1 LZO_SUPPORT=1 LZ4_SUPPORT=1"
+
+do_compile() {
+ oe_runmake mksquashfs unsquashfs
+}
+do_install () {
+ install -d ${D}${sbindir}
+ install -m 0755 mksquashfs ${D}${sbindir}/
+ install -m 0755 unsquashfs ${D}${sbindir}/
+}
+
+ARM_INSTRUCTION_SET = "arm"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch
new file mode 100644
index 000000000..aa61e15c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch
@@ -0,0 +1,176 @@
+From f32126ba790dd4e61d43a2140b24f02426297bb6 Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Thu, 31 Dec 2015 14:19:41 +0000
+Subject: [PATCH] Move gcc compat macros to gcc_compat.h
+
+* defs.h: Include "gcc_compat.h".
+(GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT,
+ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC,
+ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): Move ...
+* gcc_compat.h: ... here.
+* Makefile.am (strace_SOURCES): Add gcc_compat.h.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ Makefile.am | 1 +
+ defs.h | 43 +----------------------------------
+ gcc_compat.h | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 75 insertions(+), 42 deletions(-)
+ create mode 100644 gcc_compat.h
+
+diff --git a/Makefile.am b/Makefile.am
+index ab52778..d43608d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -97,6 +97,7 @@ strace_SOURCES = \
+ flock.c \
+ flock.h \
+ futex.c \
++ gcc_compat.h \
+ get_robust_list.c \
+ getcpu.c \
+ getcwd.c \
+diff --git a/defs.h b/defs.h
+index 283ab1f..bae212c 100644
+--- a/defs.h
++++ b/defs.h
+@@ -55,6 +55,7 @@
+ #include <sys/syscall.h>
+
+ #include "mpers_type.h"
++#include "gcc_compat.h"
+
+ #ifndef HAVE_STRERROR
+ const char *strerror(int);
+@@ -68,48 +69,6 @@ const char *strerror(int);
+ extern char *stpcpy(char *dst, const char *src);
+ #endif
+
+-#if defined __GNUC__ && defined __GNUC_MINOR__
+-# define GNUC_PREREQ(maj, min) \
+- ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+-#else
+-# define __attribute__(x) /* empty */
+-# define GNUC_PREREQ(maj, min) 0
+-#endif
+-
+-#if GNUC_PREREQ(2, 5)
+-# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
+-#else
+-# define ATTRIBUTE_NORETURN /* empty */
+-#endif
+-
+-#if GNUC_PREREQ(2, 7)
+-# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args))
+-# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg)))
+-# define ATTRIBUTE_PACKED __attribute__((__packed__))
+-#else
+-# define ATTRIBUTE_FORMAT(args) /* empty */
+-# define ATTRIBUTE_ALIGNED(arg) /* empty */
+-# define ATTRIBUTE_PACKED /* empty */
+-#endif
+-
+-#if GNUC_PREREQ(3, 0)
+-# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
+-#else
+-# define ATTRIBUTE_MALLOC /* empty */
+-#endif
+-
+-#if GNUC_PREREQ(3, 1)
+-# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
+-#else
+-# define ATTRIBUTE_NOINLINE /* empty */
+-#endif
+-
+-#if GNUC_PREREQ(4, 3)
+-# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
+-#else
+-# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
+-#endif
+-
+ #ifndef offsetof
+ # define offsetof(type, member) \
+ (((char *) &(((type *) NULL)->member)) - ((char *) (type *) NULL))
+diff --git a/gcc_compat.h b/gcc_compat.h
+new file mode 100644
+index 0000000..1f2c835
+--- /dev/null
++++ b/gcc_compat.h
+@@ -0,0 +1,73 @@
++/*
++ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#ifndef GCC_COMPAT_H_
++#define GCC_COMPAT_H_
++
++#if defined __GNUC__ && defined __GNUC_MINOR__
++# define GNUC_PREREQ(maj, min) \
++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
++#else
++# define __attribute__(x) /* empty */
++# define GNUC_PREREQ(maj, min) 0
++#endif
++
++#if GNUC_PREREQ(2, 5)
++# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
++#else
++# define ATTRIBUTE_NORETURN /* empty */
++#endif
++
++#if GNUC_PREREQ(2, 7)
++# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args))
++# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg)))
++# define ATTRIBUTE_PACKED __attribute__((__packed__))
++#else
++# define ATTRIBUTE_FORMAT(args) /* empty */
++# define ATTRIBUTE_ALIGNED(arg) /* empty */
++# define ATTRIBUTE_PACKED /* empty */
++#endif
++
++#if GNUC_PREREQ(3, 0)
++# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
++#else
++# define ATTRIBUTE_MALLOC /* empty */
++#endif
++
++#if GNUC_PREREQ(3, 1)
++# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
++#else
++# define ATTRIBUTE_NOINLINE /* empty */
++#endif
++
++#if GNUC_PREREQ(4, 3)
++# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
++#else
++# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
++#endif
++
++#endif
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch
new file mode 100644
index 000000000..a9d32037b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch
@@ -0,0 +1,117 @@
+From dd1a80c8d213eed95fe55b7ebcb07ee165dd8e4b Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Thu, 24 Dec 2015 15:40:55 +0000
+Subject: [PATCH] arc, metag, nios2, or1k, tile: fix build
+
+Fix build regression introduced by commit
+34683e3926d8c2daa368afb805da422ee7043396.
+
+* linux/32/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap.
+* linux/arc/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap_pgoff.
+* linux/nios2/syscallent.h: Likewise.
+* linux/or1k/syscallent.h: Likewise.
+* linux/tile/syscallent1.h: Add sys_ prefix to ARCH_mmap and sys_mmap_4koff.
+* pathtrace.c (pathtrace_match): Handle SEN_ARCH_mmap.
+* NEWS: Mention this build fix.
+
+Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Backport
+---
+ NEWS | 3 +++
+ linux/32/syscallent.h | 6 +++---
+ linux/arc/syscallent.h | 2 +-
+ linux/nios2/syscallent.h | 2 +-
+ linux/or1k/syscallent.h | 2 +-
+ linux/tile/syscallent1.h | 2 +-
+ pathtrace.c | 1 +
+ 7 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index fe40ca4..09263eb 100644
+--- a/NEWS
++++ b/NEWS
+@@ -1,3 +1,9 @@
++Noteworthy changes in release ?.?? (????-??-??)
++===============================================
++
++* Bug fixes
++ * Fixed build on arc, metag, nios2, or1k, and tile architectures.
++
+ Noteworthy changes in release 4.11 (2015-12-21)
+ ===============================================
+
+diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h
+index 5f997e7..e6f895c 100644
+--- a/linux/32/syscallent.h
++++ b/linux/32/syscallent.h
+@@ -1,5 +1,5 @@
+-#ifndef ARCH_mmap
+-# define ARCH_mmap mmap
++#ifndef sys_ARCH_mmap
++# define sys_ARCH_mmap sys_mmap
+ #endif
+ [ 0] = { 2, 0, SEN(io_setup), "io_setup" },
+ [ 1] = { 1, 0, SEN(io_destroy), "io_destroy" },
+@@ -276,5 +276,5 @@
+ [283] = { 2, 0, SEN(membarrier), "membarrier", },
+ [284] = { 3, TM, SEN(mlock2), "mlock2" },
+
+-#undef ARCH_mmap
++#undef sys_ARCH_mmap
+ #undef ARCH_WANT_SYNC_FILE_RANGE2
+diff --git a/linux/arc/syscallent.h b/linux/arc/syscallent.h
+index 5847dc4..1100008 100644
+--- a/linux/arc/syscallent.h
++++ b/linux/arc/syscallent.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_pgoff
++#define sys_ARCH_mmap sys_mmap_pgoff
+ #include "32/syscallent.h"
+ [244] = { 3, 0, SEN(printargs), "arc_cacheflush"},
+ [245] = { 1, 0, SEN(printargs), "arc_settls" },
+diff --git a/linux/nios2/syscallent.h b/linux/nios2/syscallent.h
+index 8a4b70e..01efe3a 100644
+--- a/linux/nios2/syscallent.h
++++ b/linux/nios2/syscallent.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_pgoff
++#define sys_ARCH_mmap sys_mmap_pgoff
+ #include "32/syscallent.h"
+ [244] = {4, 0, SEN(cacheflush), "cacheflush"},
+ [245 ... 259] = { },
+diff --git a/linux/or1k/syscallent.h b/linux/or1k/syscallent.h
+index ed84b3b..351fe25 100644
+--- a/linux/or1k/syscallent.h
++++ b/linux/or1k/syscallent.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_pgoff
++#define sys_ARCH_mmap sys_mmap_pgoff
+ #include "32/syscallent.h"
+ [244] = { 3, NF, SEN(or1k_atomic), "or1k_atomic" },
+ [245 ... 259] = { },
+diff --git a/linux/tile/syscallent1.h b/linux/tile/syscallent1.h
+index c86f059..28dbab4 100644
+--- a/linux/tile/syscallent1.h
++++ b/linux/tile/syscallent1.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_4koff
++#define sys_ARCH_mmap sys_mmap_4koff
+ #define ARCH_WANT_SYNC_FILE_RANGE2 1
+ #include "32/syscallent.h"
+ [244] = { 1, 0, SEN(printargs), "cmpxchg_badaddr" },
+diff --git a/pathtrace.c b/pathtrace.c
+index d530ec2..e72cdf7 100644
+--- a/pathtrace.c
++++ b/pathtrace.c
+@@ -216,6 +216,7 @@ pathtrace_match(struct tcb *tcp)
+ case SEN_mmap:
+ case SEN_mmap_4koff:
+ case SEN_mmap_pgoff:
++ case SEN_ARCH_mmap:
+ /* x, x, x, x, fd */
+ return fdmatch(tcp, tcp->u_arg[4]);
+
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch
new file mode 100644
index 000000000..c4e645b81
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch
@@ -0,0 +1,198 @@
+From 3fdcdd47c6a67585123a0a0c8fffabcc9f79a3a2 Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Tue, 12 Jan 2016 14:47:12 +0000
+Subject: [PATCH] scm_rights-fd.test: rewrite without fork
+
+* tests/scm_rights.c (main): Rewrite without fork.
+Place all objects passed to sendmsg and recvmsg at the end
+of memory pages followed by inaccessible pages.
+* tests/scm_rights-fd.test: Update.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ tests/scm_rights-fd.test | 12 ++---
+ tests/scm_rights.c | 122 ++++++++++++++++++++++-------------------------
+ 2 files changed, 63 insertions(+), 71 deletions(-)
+
+diff --git a/tests/scm_rights-fd.test b/tests/scm_rights-fd.test
+index a32ef36..48c5028 100755
+--- a/tests/scm_rights-fd.test
++++ b/tests/scm_rights-fd.test
+@@ -49,18 +49,18 @@ touch -- "$file" ||
+ framework_skip_ 'failed to create a file'
+
+ run_prog ./scm_rights /dev/zero
+-run_strace_merge -y -x -enetwork $args "$file"
++run_strace -y -x -enetwork $args "$file"
+
++sample='\\xf1\\xf2\\xf3\\xf4\\xf5\\xf6\\xf7\\xf8\\xf9\\xfa\\xfb\\xfc\\xfd\\xfe\\xff'
+ n='[1-9][0-9]*'
+-msg='\{msg_name\(0\)=NULL, msg_iov\(1\)=\[\{"\\x00\\x00\\x00\\x00[^"]*", '"$n"'\}\], msg_controllen='"$n"
+-rights='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, \[3</dev/null>, 4</dev/zero>, 5</[^}>]*/(A\\n){127}Z>\]\}'
++msg='\{msg_name\(0\)=NULL, msg_iov\(1\)=\[\{"'"$sample"'", 15\}\], msg_controllen='"$n"
++rights='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, \[4</dev/null>, 5</dev/zero>, 6</[^}>]*/(A\\n){127}Z>\]\}'
+ creds='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, \{pid='"$n"', uid=[0-9]+, gid=[0-9]+\}\}'
+-prefix='[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +'
+ EXPECTED="$LOG.expected"
+
+ cat > "$EXPECTED" << __EOF__
+-${prefix}sendmsg\\(1<socket:\\[[0-9]+\\]>, $msg, \\[$rights\\], msg_flags=0\\}, 0\\) += $n
+-${prefix}recvmsg\\(0<socket:\\[[0-9]+\\]>, $msg, \\[$creds, $rights\\], msg_flags=0\\}, 0\\) += $n
++sendmsg\\(3<socket:\\[[0-9]+\\]>, $msg, \\[$rights\\], msg_flags=0\\}, 0\\) = 15
++recvmsg\\(0<socket:\\[[0-9]+\\]>, $msg, \\[$creds, $rights\\], msg_flags=0\\}, 0\\) = 15
+ __EOF__
+
+ match_grep "$LOG" "$EXPECTED"
+diff --git a/tests/scm_rights.c b/tests/scm_rights.c
+index 1e5e850..00af4d5 100644
+--- a/tests/scm_rights.c
++++ b/tests/scm_rights.c
+@@ -27,26 +27,39 @@
+
+ #include "tests.h"
+ #include <assert.h>
+-#include <string.h>
+-#include <stdlib.h>
+-#include <unistd.h>
+ #include <errno.h>
+ #include <fcntl.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
+ #include <sys/socket.h>
+-#include <sys/wait.h>
+
+ int main(int ac, const char **av)
+ {
+- int i;
+- int data = 0;
+- struct iovec iov = {
+- .iov_base = &data,
+- .iov_len = sizeof(iov)
+- };
++ assert(ac > 0);
++ int fds[ac];
++
++ static const char sample[] =
++ "\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
++ const unsigned int data_size = sizeof(sample) - 1;
++ void *data = tail_alloc(data_size);
++ memcpy(data, sample, data_size);
++
++ struct iovec *iov = tail_alloc(sizeof(struct iovec));
++ iov->iov_base = data;
++ iov->iov_len = data_size;
+
+- while ((i = open("/dev/null", O_RDWR)) < 3)
++ struct msghdr *mh = tail_alloc(sizeof(struct msghdr));
++ memset(mh, 0, sizeof(*mh));
++ mh->msg_iov = iov;
++ mh->msg_iovlen = 1;
++
++ int i;
++ while ((i = open("/dev/null", O_RDWR)) <= ac + 2)
+ assert(i >= 0);
+- (void) close(3);
++ while (i > 2)
++ assert(close(i--) == 0);
++ assert(close(0) == 0);
+
+ int sv[2];
+ if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv))
+@@ -55,60 +68,39 @@ int main(int ac, const char **av)
+ if (setsockopt(sv[0], SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)))
+ perror_msg_and_skip("setsockopt");
+
+- pid_t pid = fork();
+- if (pid < 0)
+- perror_msg_and_fail("fork");
+-
+- if (pid) {
+- assert(close(sv[0]) == 0);
+- assert(dup2(sv[1], 1) == 1);
+- assert(close(sv[1]) == 0);
+-
+- int fds[ac];
+- assert((fds[0] = open("/dev/null", O_RDWR)) == 3);
+- for (i = 1; i < ac; ++i)
+- assert((fds[i] = open(av[i], O_RDONLY)) == i + 3);
+-
+- union {
+- struct cmsghdr cmsg;
+- char buf[CMSG_LEN(sizeof(fds))];
+- } control;
+-
+- control.cmsg.cmsg_level = SOL_SOCKET;
+- control.cmsg.cmsg_type = SCM_RIGHTS;
+- control.cmsg.cmsg_len = CMSG_LEN(sizeof(fds));
+- memcpy(CMSG_DATA(&control.cmsg), fds, sizeof(fds));
+-
+- struct msghdr mh = {
+- .msg_iov = &iov,
+- .msg_iovlen = 1,
+- .msg_control = &control,
+- .msg_controllen = sizeof(control)
+- };
+-
+- assert(sendmsg(1, &mh, 0) == sizeof(iov));
+- assert(close(1) == 0);
+-
+- int status;
+- assert(waitpid(pid, &status, 0) == pid);
+- assert(status == 0);
+- } else {
+- assert(close(sv[1]) == 0);
+- assert(dup2(sv[0], 0) == 0);
+- assert(close(sv[0]) == 0);
+-
+- struct cmsghdr control[4 + ac * sizeof(int) / sizeof(struct cmsghdr)];
+-
+- struct msghdr mh = {
+- .msg_iov = &iov,
+- .msg_iovlen = 1,
+- .msg_control = control,
+- .msg_controllen = sizeof(control)
+- };
+-
+- assert(recvmsg(0, &mh, 0) == sizeof(iov));
+- assert(close(0) == 0);
++ assert((fds[0] = open("/dev/null", O_RDWR)) == 4);
++ for (i = 1; i < ac; ++i)
++ assert((fds[i] = open(av[i], O_RDONLY)) == i + 4);
++
++ unsigned int cmsg_size = CMSG_SPACE(sizeof(fds));
++ struct cmsghdr *cmsg = tail_alloc(cmsg_size);
++ memset(cmsg, 0, cmsg_size);
++ cmsg->cmsg_level = SOL_SOCKET;
++ cmsg->cmsg_type = SCM_RIGHTS;
++ cmsg->cmsg_len = CMSG_LEN(sizeof(fds));
++ memcpy(CMSG_DATA(cmsg), fds, sizeof(fds));
++
++ mh->msg_control = cmsg;
++ mh->msg_controllen = cmsg_size;
++
++ assert(sendmsg(sv[1], mh, 0) == (int) data_size);
++
++ assert(close(sv[1]) == 0);
++ assert(open("/dev/null", O_RDWR) == sv[1]);
++
++ for (i = 0; i < ac; ++i) {
++ assert(close(fds[i]) == 0);
++ fds[i] = 0;
+ }
+
++ cmsg_size += CMSG_SPACE(sizeof(struct ucred));
++ cmsg = tail_alloc(cmsg_size);
++ memset(cmsg, 0, cmsg_size);
++ mh->msg_control = cmsg;
++ mh->msg_controllen = cmsg_size;
++
++ assert(recvmsg(0, mh, 0) == (int) data_size);
++ assert(close(0) == 0);
++
+ return 0;
+ }
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch
new file mode 100644
index 000000000..1575ecd22
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch
@@ -0,0 +1,306 @@
+From 87e6b230fff800eb768b68b2e5173ebbe83fd3ef Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Sat, 2 Jan 2016 12:05:14 +0000
+Subject: [PATCH] tests: introduce libtests
+
+Introduce tests/libtests.a with common functions for use in tests.
+
+* tests/tests.h: New file.
+* tests/error_msg.c: Likewise.
+* tests/tail_alloc.c: Likewise.
+* tests/get_page_size.c: Likewise.
+* tests/Makefile.am (libtests_a_SOURCES, libtests_a_CPPFLAGS,
+check_LIBRARIES, LDADD): New variables.
+(clock_xettime_LDADD, filter_unavailable_LDADD, mq_LDADD,
+pc_LDADD, times_LDADD): Add $(LDADD).
+* tests/.gitignore: Add libtests.a.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ tests/.gitignore | 1 +
+ tests/Makefile.am | 20 ++++++++++----
+ tests/error_msg.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ tests/get_page_size.c | 13 +++++++++
+ tests/tail_alloc.c | 52 ++++++++++++++++++++++++++++++++++++
+ tests/tests.h | 62 ++++++++++++++++++++++++++++++++++++++++++
+ 6 files changed, 217 insertions(+), 5 deletions(-)
+ create mode 100644 tests/error_msg.c
+ create mode 100644 tests/get_page_size.c
+ create mode 100644 tests/tail_alloc.c
+ create mode 100644 tests/tests.h
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 386a2c2..62d0e56 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -40,6 +40,16 @@ AM_CPPFLAGS = $(ARCH_MFLAGS) \
+ -I$(top_srcdir)
+ AM_LDFLAGS = $(ARCH_MFLAGS)
+
++libtests_a_SOURCES = \
++ get_page_size.c \
++ error_msg.c \
++ tail_alloc.c \
++ tests.h \
++ # end of libtests_a_SOURCES
++libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
++check_LIBRARIES = libtests.a
++LDADD = libtests.a
++
+ check_PROGRAMS = \
+ _newselect \
+ adjtimex \
+@@ -146,19 +156,19 @@ check_PROGRAMS = \
+ xettimeofday \
+ # end of check_PROGRAMS
+
+-clock_xettime_LDADD = -lrt
+-filter_unavailable_LDADD = -lpthread
++clock_xettime_LDADD = -lrt $(LDADD)
++filter_unavailable_LDADD = -lpthread $(LDADD)
+ fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+-mq_LDADD = -lrt
++mq_LDADD = -lrt $(LDADD)
+ newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+-pc_LDADD = $(dl_LIBS)
++pc_LDADD = $(dl_LIBS) $(LDADD)
+ stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+-times_LDADD = -lrt
++times_LDADD = -lrt $(LDADD)
+ truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ stack_fcall_SOURCES = stack-fcall.c \
+diff --git a/tests/error_msg.c b/tests/error_msg.c
+new file mode 100644
+index 0000000..3fd3411
+--- /dev/null
++++ b/tests/error_msg.c
+@@ -0,0 +1,74 @@
++/*
++ * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#include "tests.h"
++#include <errno.h>
++#include <stdarg.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++void
++perror_msg_and_fail(const char *fmt, ...)
++{
++ int err_no = errno;
++ va_list p;
++
++ va_start(p, fmt);
++ vfprintf(stderr, fmt, p);
++ if (err_no)
++ fprintf(stderr, ": %s\n", strerror(err_no));
++ else
++ putc('\n', stderr);
++ exit(1);
++}
++
++void
++error_msg_and_skip(const char *fmt, ...)
++{
++ va_list p;
++
++ va_start(p, fmt);
++ vfprintf(stderr, fmt, p);
++ putc('\n', stderr);
++ exit(77);
++}
++
++void
++perror_msg_and_skip(const char *fmt, ...)
++{
++ int err_no = errno;
++ va_list p;
++
++ va_start(p, fmt);
++ vfprintf(stderr, fmt, p);
++ if (err_no)
++ fprintf(stderr, ": %s\n", strerror(err_no));
++ else
++ putc('\n', stderr);
++ exit(77);
++}
+diff --git a/tests/get_page_size.c b/tests/get_page_size.c
+new file mode 100644
+index 0000000..aeea861
+--- /dev/null
++++ b/tests/get_page_size.c
+@@ -0,0 +1,13 @@
++#include "tests.h"
++#include <unistd.h>
++
++size_t
++get_page_size(void)
++{
++ static size_t page_size;
++
++ if (!page_size)
++ page_size = sysconf(_SC_PAGESIZE);
++
++ return page_size;
++}
+diff --git a/tests/tail_alloc.c b/tests/tail_alloc.c
+new file mode 100644
+index 0000000..2b8b14e
+--- /dev/null
++++ b/tests/tail_alloc.c
+@@ -0,0 +1,52 @@
++/*
++ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#include "tests.h"
++#include <string.h>
++#include <sys/mman.h>
++
++void *
++tail_alloc(const size_t size)
++{
++ const size_t page_size = get_page_size();
++ const size_t len = (size + page_size - 1) & -page_size;
++ const size_t alloc_size = len + 2 * page_size;
++
++ void *p = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE,
++ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
++ if (MAP_FAILED == p)
++ perror_msg_and_fail("mmap(%zu)", alloc_size);
++
++ void *start_work = p + page_size;
++ void *tail_guard = start_work + len;
++
++ if (munmap(p, page_size) || munmap(tail_guard, page_size))
++ perror_msg_and_fail("munmap");
++
++ memset(start_work, 0xff, len);
++ return tail_guard - size;
++}
+diff --git a/tests/tests.h b/tests/tests.h
+new file mode 100644
+index 0000000..91fa24e
+--- /dev/null
++++ b/tests/tests.h
+@@ -0,0 +1,62 @@
++/*
++ * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#ifndef TESTS_H_
++# define TESTS_H_
++
++# ifdef HAVE_CONFIG_H
++# include "config.h"
++# endif
++
++# include <sys/types.h>
++# include "gcc_compat.h"
++
++/* Cached sysconf(_SC_PAGESIZE). */
++size_t get_page_size(void);
++
++/* Print message and strerror(errno) to stderr, then exit(1). */
++void perror_msg_and_fail(const char *, ...)
++ ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
++/* Print message to stderr, then exit(77). */
++void error_msg_and_skip(const char *, ...)
++ ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
++/* Print message and strerror(errno) to stderr, then exit(77). */
++void perror_msg_and_skip(const char *, ...)
++ ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
++
++/*
++ * Allocate memory that ends on the page boundary.
++ * Pages allocated by this call are preceeded by an unmapped page
++ * and followed also by an unmapped page.
++ */
++void *tail_alloc(const size_t)
++ ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1));
++
++# define SKIP_MAIN_UNDEFINED(arg) \
++ int main(void) { error_msg_and_skip("undefined: %s", arg); }
++
++#endif
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch
new file mode 100644
index 000000000..3fbab8b66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch
@@ -0,0 +1,54 @@
+From 339a15b619b479c63cafba21d5fc359e613d9ee8 Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Mon, 4 Jan 2016 23:53:31 +0000
+Subject: [PATCH] tests/scm_rights.c: use libtests
+
+* tests/scm_rights.c (main): Use perror_msg_and_fail and perror_msg_and_skip.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ tests/scm_rights.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/tests/scm_rights.c b/tests/scm_rights.c
+index c41444f..1e5e850 100644
+--- a/tests/scm_rights.c
++++ b/tests/scm_rights.c
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
++ * Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+@@ -25,6 +25,7 @@
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#include "tests.h"
+ #include <assert.h>
+ #include <string.h>
+ #include <stdlib.h>
+@@ -48,12 +49,15 @@ int main(int ac, const char **av)
+ (void) close(3);
+
+ int sv[2];
+- assert(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);
++ if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv))
++ perror_msg_and_skip("socketpair");
+ int one = 1;
+- assert(setsockopt(sv[0], SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)) == 0);
++ if (setsockopt(sv[0], SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)))
++ perror_msg_and_skip("setsockopt");
+
+ pid_t pid = fork();
+- assert(pid >= 0);
++ if (pid < 0)
++ perror_msg_and_fail("fork");
+
+ if (pid) {
+ assert(close(sv[0]) == 0);
+--
+1.9.1
+
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
new file mode 100644
index 000000000..824031e86
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch
@@ -0,0 +1,53 @@
+strace: Add ptest
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Gabriel Barbu <gabriel.barbu@enea.com>
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ configure.ac | 2 +-
+ tests/Makefile.am | 18 ++++++++++++++++++
+ 2 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0209bac..b969e25 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -36,7 +36,7 @@ AC_INIT([strace],
+ AC_CONFIG_SRCDIR([strace.c])
+ AC_CONFIG_AUX_DIR([.])
+ AC_CONFIG_HEADERS([config.h])
+-AM_INIT_AUTOMAKE([foreign nostdinc dist-xz no-dist-gzip silent-rules parallel-tests])
++AM_INIT_AUTOMAKE([foreign nostdinc dist-xz no-dist-gzip silent-rules serial-tests])
+ AM_MAINTAINER_MODE
+ AC_CANONICAL_HOST
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 0f23b4b..429f7e9 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -332,3 +332,21 @@ ksysent.h: $(srcdir)/ksysent.sed
+
+ BUILT_SOURCES = ksysent.h
+ CLEANFILES = ksysent.h $(TESTS:=.tmp)
++
++buildtest-TESTS: $(check_PROGRAMS) $(TESTS)
++
++install-ptest:
++ install $(BUILDDIR)/strace $(DESTDIR)
++ install $(srcdir)/../strace-log-merge $(DESTDIR)
++ install -d $(DESTDIR)/$(TESTDIR)
++ cp $(BUILDDIR)/$(TESTDIR)/Makefile $(DESTDIR)/$(TESTDIR)
++ sed -i -e 's/^Makefile:/_Makefile:/' $(DESTDIR)/$(TESTDIR)/Makefile
++ sed -i -e 's/bash/sh/' $(DESTDIR)/$(TESTDIR)/Makefile
++ for file in $(check_PROGRAMS); do \
++ install $(BUILDDIR)/$(TESTDIR)/$$file $(DESTDIR)/$(TESTDIR); \
++ done
++ for file in $(EXTRA_DIST); do \
++ install $(srcdir)/$$file $(DESTDIR)/$(TESTDIR); \
++ sed -i -e 's/$${srcdir=.}/./g' $(DESTDIR)/$(TESTDIR)/$$file; \
++ done
++ for i in net net-fd scm_rights-fd sigaction; do sed -i -e 's/$$srcdir/./g' $(DESTDIR)/$(TESTDIR)/$$i.test; done
+--
+1.9.1
+
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
new file mode 100644
index 000000000..7bc143635
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch
@@ -0,0 +1,20 @@
+The git-version-gen script is not included in tarball releases,
+so we need to avoid attempts to call it when running autoreconf.
+
+Upstream-Status: Inappropriate [configuration]
+
+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.
+ 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([.])
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch
new file mode 100644
index 000000000..756cd8bb8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch
@@ -0,0 +1,46 @@
+From 154af50ed7ed8b91838d713052ebf29b0b14f765 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Mon, 18 Jan 2016 11:00:00 -0800
+Subject: [PATCH] mpers.m4: more robust test for -m32/-mx32 compile support
+
+When using the default OE toolchain for x86-64, the basic checks for
+-m32 and -mx32 compile support in mpers.m4 pass but later attempts to
+actually use the toolchain with -m32 fail, e.g.
+
+ | In file included from /home/andre/build/tmp/sysroots/qemux86-64/usr/include/sys/syscall.h:31:0,
+ | from ../strace-4.11/defs.h:55,
+ | from mpers-m32/kernel_dirent.c:32:
+ | /home/andre/build/tmp/sysroots/qemux86-64/usr/include/bits/syscall.h:41:29: fatal error: bits/syscall-32.h: No such file or directory
+
+Make the mpers.m4 tests more robust so that configure correctly
+detects the limitations of the OE toolchain.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ m4/mpers.m4 | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/m4/mpers.m4 b/m4/mpers.m4
+index 1fe8a8e..d72c717 100644
+--- a/m4/mpers.m4
++++ b/m4/mpers.m4
+@@ -53,12 +53,14 @@ case "$arch" in
+ CFLAGS="$CFLAGS CFLAG $IFLAG"
+ AC_CACHE_CHECK([for CFLAG compile support], [st_cv_cc],
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdint.h>
++ #include <sys/syscall.h>
+ int main(){return 0;}]])],
+ [st_cv_cc=yes],
+ [st_cv_cc=no])])
+ if test $st_cv_cc = yes; then
+ AC_CACHE_CHECK([for CFLAG runtime support], [st_cv_runtime],
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdint.h>
++ #include <sys/syscall.h>
+ int main(){return 0;}]])],
+ [st_cv_runtime=yes],
+ [st_cv_runtime=no],
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/run-ptest
new file mode 100755
index 000000000..133cf92d0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -C tests -k runtest-TESTS
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch
new file mode 100644
index 000000000..bfc7f3441
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch
@@ -0,0 +1,118 @@
+From 3836518c46bd5bb3e71371b1b18274bf2d487133 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Mon, 18 Jan 2016 11:01:00 -0800
+Subject: [PATCH] update gawk paths, /bin/gawk -> /usr/bin/gawk
+
+The default path to gawk is /usr/bin/gawk, so update test scripts etc
+from #!/bin/gawk to #!/usr/bin/gawk. Fixes missing RDPENDS QA tests:
+
+ WARNING: QA Issue: /usr/lib/strace/ptest/tests/unix-yy-accept.awk_strace-ptest contained in package strace-ptest requires /bin/gawk, but no providers found in its RDEPENDS [file-rdeps]
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ mpers.awk | 2 +-
+ tests/caps.awk | 2 +-
+ tests/match.awk | 2 +-
+ tests/net-yy-accept.awk | 2 +-
+ tests/net-yy-connect.awk | 2 +-
+ tests/sigaction.awk | 2 +-
+ tests/uid.awk | 2 +-
+ tests/unix-yy-accept.awk | 2 +-
+ tests/unix-yy-connect.awk | 2 +-
+ 9 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/mpers.awk b/mpers.awk
+index 73bf0b0..50e6c16 100644
+--- a/mpers.awk
++++ b/mpers.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ # Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+diff --git a/tests/caps.awk b/tests/caps.awk
+index bad8b0f..845f37c 100644
+--- a/tests/caps.awk
++++ b/tests/caps.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # All rights reserved.
+diff --git a/tests/match.awk b/tests/match.awk
+index abfbae9..f2740bf 100644
+--- a/tests/match.awk
++++ b/tests/match.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # All rights reserved.
+diff --git a/tests/net-yy-accept.awk b/tests/net-yy-accept.awk
+index fed3e30..e916ab0 100644
+--- a/tests/net-yy-accept.awk
++++ b/tests/net-yy-accept.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+diff --git a/tests/net-yy-connect.awk b/tests/net-yy-connect.awk
+index f4dcf91..b3cec8c 100644
+--- a/tests/net-yy-connect.awk
++++ b/tests/net-yy-connect.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+diff --git a/tests/sigaction.awk b/tests/sigaction.awk
+index 5c6b6d0..3e14464 100644
+--- a/tests/sigaction.awk
++++ b/tests/sigaction.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # All rights reserved.
+diff --git a/tests/uid.awk b/tests/uid.awk
+index a56c5be..67b0749 100644
+--- a/tests/uid.awk
++++ b/tests/uid.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # All rights reserved.
+diff --git a/tests/unix-yy-accept.awk b/tests/unix-yy-accept.awk
+index 4ed60e4..2a9d9c0 100644
+--- a/tests/unix-yy-accept.awk
++++ b/tests/unix-yy-accept.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+diff --git a/tests/unix-yy-connect.awk b/tests/unix-yy-connect.awk
+index 262bf2e..c809dfa 100644
+--- a/tests/unix-yy-connect.awk
++++ b/tests/unix-yy-connect.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+--
+1.9.1
+
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
new file mode 100644
index 000000000..db83d1130
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/use-asm-sgidefs.h.patch
@@ -0,0 +1,51 @@
+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.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace_4.11.bb
new file mode 100644
index 000000000..739138802
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace_4.11.bb
@@ -0,0 +1,51 @@
+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://0001-arc-metag-nios2-or1k-tile-fix-build.patch \
+ file://Makefile-ptest.patch \
+ file://0001-tests-scm_rights.c-use-libtests.patch \
+ file://0001-scm_rights-fd.test-rewrite-without-fork.patch \
+ file://0001-Move-gcc-compat-macros-to-gcc_compat.h.patch \
+ file://0001-tests-introduce-libtests.patch \
+ file://run-ptest \
+ "
+
+SRC_URI[md5sum] = "a15d2555a7febb56d00c6e1a51c655dc"
+SRC_URI[sha256sum] = "e86a5f6cd8f941f67f3e4b28f4e60f3d9185c951cf266404533210a2e5cd8152"
+
+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"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-Fix-libtool-name-in-configure.ac.patch b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-Fix-libtool-name-in-configure.ac.patch
new file mode 100644
index 000000000..5a1b10b2e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-Fix-libtool-name-in-configure.ac.patch
@@ -0,0 +1,29 @@
+From cbcfe0399347989e45a8fb695f55c855d6b3da72 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 7 Dec 2015 17:11:02 +0200
+Subject: [PATCH] Fix libtool name in configure.ac
+
+Upstream-Status: Inappropriate [embedded specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4ed66d4..ceb64f9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -221,8 +221,8 @@ if test "$experimental_libtool" = "yes"; then
+ LIBTOOL="$sh_libtool"
+ SVN_LIBTOOL="$sh_libtool"
+ else
+- sh_libtool="$abs_builddir/libtool"
+- SVN_LIBTOOL="\$(SHELL) \"$sh_libtool\""
++ sh_libtool="$abs_builddir/$host_alias-libtool"
++ SVN_LIBTOOL="\$(SHELL) \$(abs_builddir)/$host_alias-libtool"
+ fi
+ AC_SUBST(SVN_LIBTOOL)
+
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/disable_macos.patch b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/disable_macos.patch
new file mode 100644
index 000000000..ec3be496f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/disable_macos.patch
@@ -0,0 +1,68 @@
+These tests don't work in cross compiling, just disable them for now, we don't
+build subversion on OS-X at this time.
+
+RP 1014/7/16
+
+Upstream-Status: Pending [needs a rewrite to support a cache value]
+
+Index: subversion-1.8.9/build/ac-macros/macosx.m4
+===================================================================
+--- subversion-1.8.9.orig/build/ac-macros/macosx.m4 2012-11-26 03:04:27.000000000 +0000
++++ subversion-1.8.9/build/ac-macros/macosx.m4 2014-07-16 12:28:58.357300403 +0000
+@@ -24,21 +24,7 @@
+ AC_DEFUN(SVN_LIB_MACHO_ITERATE,
+ [
+ AC_MSG_CHECKING([for Mach-O dynamic module iteration functions])
+- AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+- #include <mach-o/dyld.h>
+- #include <mach-o/loader.h>
+- ]],[[
+- const struct mach_header *header = _dyld_get_image_header(0);
+- const char *name = _dyld_get_image_name(0);
+- if (name && header) return 0;
+- return 1;
+- ]])],[
+- AC_DEFINE([SVN_HAVE_MACHO_ITERATE], [1],
+- [Is Mach-O low-level _dyld API available?])
+- AC_MSG_RESULT([yes])
+- ],[
+ AC_MSG_RESULT([no])
+- ])
+ ])
+
+ dnl SVN_LIB_MACOS_PLIST
+@@ -46,34 +32,7 @@
+ AC_DEFUN(SVN_LIB_MACOS_PLIST,
+ [
+ AC_MSG_CHECKING([for Mac OS property list utilities])
+-
+- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+- #include <AvailabilityMacros.h>
+- #if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) \
+- || !defined(MAC_OS_X_VERSION_10_0) \
+- || (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_0)
+- #error ProperyList API unavailable.
+- #endif
+- ]],[[]])],[
+- dnl ### Hack. We should only need to pass the -framework options when
+- dnl linking libsvn_subr, since it is the only library that uses Keychain.
+- dnl
+- dnl Unfortunately, libtool 1.5.x doesn't track transitive dependencies for
+- dnl OS X frameworks like it does for normal libraries, so we need to
+- dnl explicitly pass the option to all the users of libsvn_subr to allow
+- dnl static builds to link successfully.
+- dnl
+- dnl This does mean that all executables we link will be linked directly
+- dnl to these frameworks - even when building shared libraries - but that
+- dnl shouldn't cause any problems.
+-
+- LIBS="$LIBS -framework CoreFoundation"
+- AC_DEFINE([SVN_HAVE_MACOS_PLIST], [1],
+- [Is Mac OS property list API available?])
+- AC_MSG_RESULT([yes])
+- ],[
+ AC_MSG_RESULT([no])
+- ])
+ ])
+
+ dnl SVN_LIB_MACOS_KEYCHAIN
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/serf.m4-Regex-modified-to-allow-D-in-paths.patch b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/serf.m4-Regex-modified-to-allow-D-in-paths.patch
new file mode 100644
index 000000000..9fed3cf6c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/serf.m4-Regex-modified-to-allow-D-in-paths.patch
@@ -0,0 +1,32 @@
+From f1b6e49f12a18eabe88eb732b578a16281d09499 Mon Sep 17 00:00:00 2001
+From: Jose Lamego <jose.a.lamego@linux.intel.com>
+Date: Thu, 2 Jul 2015 11:37:43 +0000
+Subject: [PATCH] serf.m4: Regex modified to allow '-D' in paths
+
+Upstream-Status: Accepted
+
+The patch is merged by subversion upstream with replacing '[[:space:]]' with ' '.
+
+http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/serf.m4?r1=1594156&r2=1689824
+
+Signed-off-by: Jose Lamego <jose.a.lamego@linux.intel.com>
+---
+ build/ac-macros/serf.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/ac-macros/serf.m4 b/build/ac-macros/serf.m4
+index ae11e75..ff8cbae 100644
+--- a/build/ac-macros/serf.m4
++++ b/build/ac-macros/serf.m4
+@@ -168,7 +168,7 @@
+ if $PKG_CONFIG $serf_pc_arg --atleast-version=$serf_check_version; then
+ AC_MSG_RESULT([yes])
+ serf_found=yes
+- SVN_SERF_INCLUDES=[`$PKG_CONFIG $serf_pc_arg --cflags | $SED -e 's/-D[^ ]*//g'`]
++ SVN_SERF_INCLUDES=[`$PKG_CONFIG $serf_pc_arg --cflags | $SED -e 's/ -D[^ ]*//g' -e 's/^-D[^ ]*//g'`]
+ SVN_SERF_LIBS=`$PKG_CONFIG $serf_pc_arg --libs-only-l`
+ dnl don't use --libs-only-L because then we might miss some options
+ LDFLAGS=["$LDFLAGS `$PKG_CONFIG $serf_pc_arg --libs | $SED -e 's/-l[^ ]*//g'`"]
+--
+1.8.4.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.3.bb
new file mode 100644
index 000000000..a19a675c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.3.bb
@@ -0,0 +1,53 @@
+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 pythonnative
+
+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 \
+ "
+SRC_URI[md5sum] = "243036eb28b50ce517fc228eb3250add"
+SRC_URI[sha256sum] = "8bbf6bb125003d88ee1c22935a36b7b1ab7d957e0c8b5fbfe5cb6310b6e86ae0"
+
+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/swabber/swabber-native_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/swabber/swabber-native_git.bb
new file mode 100644
index 000000000..2f313bb46
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/swabber/swabber-native_git.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Tool to monitor and report on host system file usage"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/swabber"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+SRCREV = "2d1fe36fb0a4fdaae8823a9818a6785182d75e66"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://git.yoctoproject.org/swabber"
+
+inherit native
+
+do_configure () {
+ :
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/swig/swig.inc b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig.inc
new file mode 100644
index 000000000..9da40df55
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig.inc
@@ -0,0 +1,63 @@
+SUMMARY = "SWIG - Simplified Wrapper and Interface Generator"
+HOMEPAGE = "http://swig.sourceforge.net/"
+LICENSE = "BSD & GPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e7807a6282784a7dde4c846626b08fc6 \
+ file://LICENSE-GPL;md5=d32239bcb673463ab874e80d47fae504 \
+ file://LICENSE-UNIVERSITIES;md5=8ce9dcc8f7c994de4a408b205c72ba08"
+
+SECTION = "devel"
+
+DEPENDS = "libpcre python"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz"
+
+inherit autotools pythonnative
+
+EXTRA_OECONF = " \
+ --with-python=${PYTHON} \
+ --without-allegrocl \
+ --without-android \
+ --without-boost \
+ --without-chicken \
+ --without-clisp \
+ --without-csharp \
+ --without-d \
+ --without-gcj \
+ --without-go \
+ --without-guile \
+ --without-java \
+ --without-lua \
+ --without-mzscheme \
+ --without-ocaml \
+ --without-octave \
+ --without-perl5 \
+ --without-pike \
+ --without-php \
+ --without-python3 \
+ --without-r \
+ --without-ruby \
+ --without-tcl \
+"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_configure() {
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/Tools/config
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/Tools/config
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
+ oe_runconf
+}
+
+do_install_append_class-nativesdk() {
+ cd ${D}${bindir}
+ ln -s swig swig2.0
+}
+
+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))
+
+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/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch
new file mode 100644
index 000000000..81df3e264
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch
@@ -0,0 +1,69 @@
+From a4a0440a644c6c5e5da096efe3cf05ba309a284f Mon Sep 17 00:00:00 2001
+From: "NODA, Kai" <nodakai@gmail.com>
+Date: Sun, 22 Apr 2012 17:01:02 +0900
+Subject: [PATCH] Use /proc/self/exe for "swig -swiglib" on non-Win32
+ platforms.
+
+If it wasn't found, then fall back to a fixed string just as before.
+
+Upstream-Status: Submitted
+http://sourceforge.net/mailarchive/message.php?msg_id=29179733
+
+---
+ Source/Modules/main.cxx | 24 ++++++++++++++++++++++--
+ 1 file changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx
+index d2f5d3b..cbb0a12 100644
+--- a/Source/Modules/main.cxx
++++ b/Source/Modules/main.cxx
+@@ -26,6 +26,11 @@ char cvsroot_main_cxx[] = "$Id$";
+ #include "cparse.h"
+ #include <ctype.h>
+ #include <limits.h> // for INT_MAX
++#ifndef _WIN32
++#include <cstddef>
++#include <unistd.h> // for readlink
++#include <sys/stat.h> // for stat
++#endif
+
+ // Global variables
+
+@@ -902,9 +907,9 @@ int SWIG_main(int argc, char *argv[], Language *l) {
+
+ // Check for SWIG_LIB environment variable
+ if ((c = getenv("SWIG_LIB")) == (char *) 0) {
++ char *p;
+ #if defined(_WIN32)
+ char buf[MAX_PATH];
+- char *p;
+ if (!(GetModuleFileName(0, buf, MAX_PATH) == 0 || (p = strrchr(buf, '\\')) == 0)) {
+ *(p + 1) = '\0';
+ SwigLib = NewStringf("%sLib", buf); // Native windows installation path
+@@ -914,7 +919,22 @@ int SWIG_main(int argc, char *argv[], Language *l) {
+ if (Len(SWIG_LIB_WIN_UNIX) > 0)
+ SwigLibWinUnix = NewString(SWIG_LIB_WIN_UNIX); // Unix installation path using a drive letter (for msys/mingw)
+ #else
+- SwigLib = NewString(SWIG_LIB);
++ char buf[PATH_MAX];
++ if (0 < ::readlink("/proc/self/exe", buf, sizeof(buf)) &&
++ (p = ::strstr(buf, "/bin/swig"))) {
++ int major, minor, patch;
++ const int ret = ::sscanf(VERSION, "%d.%d.%d", &major, &minor, &patch);
++ if (3 == ret) {
++ const ::ptrdiff_t dir_part_len = p - buf;
++ ::snprintf(p, PATH_MAX - dir_part_len, "/share/swig/%d.%d.%d", major, minor, patch);
++ struct ::stat stat_res;
++ if (0 == ::stat(buf, &stat_res) && S_ISDIR(stat_res.st_mode)) {
++ SwigLib = NewString(buf);
++ }
++ }
++ }
++ if (NULL == SwigLib)
++ SwigLib = NewString(SWIG_LIB);
+ #endif
+ } else {
+ SwigLib = NewString(c);
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch
new file mode 100644
index 000000000..1b1128aca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch
@@ -0,0 +1,64 @@
+From 5c4d6d8538994d5fe9b3b46bfafaf0a605e3bda6 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen.kooi@linaro.org>
+Date: Tue, 17 Jun 2014 08:18:17 +0200
+Subject: [PATCH] configure: use pkg-config for pcre detection
+
+Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
+Upstream-Status: pending
+---
+ configure.ac | 38 +++++++-------------------------------
+ 1 file changed, 7 insertions(+), 31 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0c984b7..6edcec1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -70,38 +70,14 @@ AC_MSG_RESULT([$with_pcre])
+
+ dnl To make configuring easier, check for a locally built PCRE using the Tools/pcre-build.sh script
+ if test x"${with_pcre}" = xyes ; then
+- AC_MSG_CHECKING([whether to use local PCRE])
+- local_pcre_config=no
+- if test -z $PCRE_CONFIG; then
+- if test -f `pwd`/pcre/pcre-swig-install/bin/pcre-config; then
+- PCRE_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre-config
+- local_pcre_config=$PCRE_CONFIG
+- fi
+- fi
+- AC_MSG_RESULT([$local_pcre_config])
+-fi
+-AS_IF([test "x$with_pcre" != xno],
+- [AX_PATH_GENERIC([pcre],
+- [], dnl Minimal version of PCRE we need -- accept any
+- [], dnl custom sed script for version parsing is not needed
+- [AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
+- LIBS="$LIBS $PCRE_LIBS"
+- CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS"
+- ],
+- [AC_MSG_FAILURE([
+- Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions)
+- library package. This dependency is needed for configure to complete,
+- Either:
+- - Install the PCRE developer package on your system (preferred approach).
+- - Download the PCRE source tarball, build and install on your system
+- as you would for any package built from source distribution.
+- - Use the Tools/pcre-build.sh script to build PCRE just for SWIG to statically
+- link against. Run 'Tools/pcre-build.sh --help' for instructions.
+- (quite easy and does not require privileges to install PCRE on your system)
+- - Use configure --without-pcre to disable regular expressions support in SWIG
+- (not recommended).])
+- ])
++ PKG_CHECK_MODULES([PCRE], [libpcre], [
++ AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
++ LIBS="$LIBS $PCRE_LIBS"
++ CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS"
++ ], [
++ AC_MSG_WARN([$PCRE_PKG_ERRORS])
+ ])
++fi
+
+
+ dnl CCache
+--
+1.9.3
+
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
new file mode 100644
index 000000000..c1b820e0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/swig/swig_3.0.8.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] = "c96a1d5ecb13d38604d7e92148c73c97"
+SRC_URI[sha256sum] = "58a475dbbd4a4d7075e5fe86d4e54c9edde39847cdb96a3053d87cb64a23a453"
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch
new file mode 100644
index 000000000..3ab787527
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch
@@ -0,0 +1,84 @@
+From 60f3833ab2b5899771b4eab654e88f9888b99501 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:01:55 +0800
+Subject: [PATCH 1/9] linux/syslinux: support ext2/3/4 device
+
+* Support ext2/3/4 deivce.
+* The open_ext2_fs() checks whether it is an ext2/3/4 device,
+ do the ext2/3/4 installation (install_to_ext2()) if yes, otherwise go
+ on to the fat/ntfs.
+* The ext2/3/4 support doesn't require root privileges since it doesn't need
+ mount (but write permission is required).
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index 912de71..36fc202 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -256,6 +256,23 @@ int do_open_file(char *name)
+ return fd;
+ }
+
++/*
++ * Check whether the device contains an ext2, ext3 or ext4 fs and open it if
++ * true.
++ * return value:
++ * 0: Everything is OK
++ * 1: Not an ext2, ext3 or ext4
++ * -1: unexpected error
++ */
++static int open_ext2_fs(const char *device, const char *subdir)
++{
++}
++
++/* The install func for ext2, ext3 and ext4 */
++static int install_to_ext2(const char *device, int dev_fd, const char *subdir)
++{
++}
++
+ int main(int argc, char *argv[])
+ {
+ static unsigned char sectbuf[SECTOR_SIZE];
+@@ -313,6 +330,24 @@ int main(int argc, char *argv[])
+ die("can't combine an offset with a block device");
+ }
+
++ /*
++ * Check if it is an ext2, ext3 or ext4
++ */
++ rv = open_ext2_fs(opt.device, subdir);
++ if (rv == 0) {
++ if (install_to_ext2(opt.device, dev_fd, subdir)) {
++ fprintf(stderr, "%s: installation failed\n", opt.device);
++ exit(1);
++ }
++ return 0;
++ /* Unexpected errors */
++ } else if (rv == -1) {
++ exit(1);
++ }
++
++ /* Reset rv */
++ rv = 0;
++
+ xpread(dev_fd, sectbuf, SECTOR_SIZE, opt.offset);
+ fsync(dev_fd);
+
+@@ -322,6 +357,7 @@ int main(int argc, char *argv[])
+ */
+ if ((errmsg = syslinux_check_bootsect(sectbuf, &fs_type))) {
+ fprintf(stderr, "%s: %s\n", opt.device, errmsg);
++ fprintf(stderr, "%s: supported fs: fat/ntfs/ext2/ex3/ext4\n", program);
+ exit(1);
+ }
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch
new file mode 100644
index 000000000..77cf06045
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch
@@ -0,0 +1,141 @@
+From 07fb737fb60c08eaaa41989d531fc23009523546 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:09:18 +0800
+Subject: [PATCH 2/9] linux/syslinux: implement open_ext2_fs()
+
+The open_ext2_fs() checks whether it is an ext2/ext3/ext4 device, and
+return:
+0: It is an ext2, ext3 or ext4.
+1: Not an ext2, ext3 or ext4.
+-1: unexpected error.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/Makefile | 2 +-
+ linux/syslinux.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 81 insertions(+), 1 deletion(-)
+
+diff --git a/linux/Makefile b/linux/Makefile
+index 11667e1..ac1ac58 100644
+--- a/linux/Makefile
++++ b/linux/Makefile
+@@ -51,7 +51,7 @@ spotless: clean
+ installer: syslinux syslinux-nomtools
+
+ syslinux: $(OBJS)
+- $(CC) $(LDFLAGS) -o $@ $^
++ $(CC) $(LDFLAGS) -o $@ $^ -lext2fs
+
+ syslinux-nomtools: syslinux
+ ln -f $< $@
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index 36fc202..cc4e7da 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -72,6 +72,7 @@
+ #include "syslxfs.h"
+ #include "setadv.h"
+ #include "syslxopt.h" /* unified options */
++#include <ext2fs/ext2fs.h>
+
+ extern const char *program; /* Name of program */
+
+@@ -82,6 +83,9 @@ char *mntpath = NULL; /* Path on which to mount */
+ int loop_fd = -1; /* Loop device */
+ #endif
+
++ext2_filsys e2fs = NULL; /* Ext2/3/4 filesystem */
++ext2_ino_t root, cwd; /* The root and cwd of e2fs */
++
+ void __attribute__ ((noreturn)) die(const char *msg)
+ {
+ fprintf(stderr, "%s: %s\n", program, msg);
+@@ -266,6 +270,82 @@ int do_open_file(char *name)
+ */
+ static int open_ext2_fs(const char *device, const char *subdir)
+ {
++ int retval;
++ int open_flag = EXT2_FLAG_RW, mount_flags;
++ ext2_ino_t dirino;
++ char opt_string[40];
++
++ if (opt.offset) {
++ sprintf(opt_string, "offset=%llu", (unsigned long long)opt.offset);
++ retval = ext2fs_open2(device, opt_string, open_flag, 0, 0, unix_io_manager, &e2fs);
++ } else
++ retval = ext2fs_open(device, open_flag, 0, 0, unix_io_manager, &e2fs);
++ if (retval) {
++ /* It might not be an extN fs, so we need check magic firstly */
++ if (retval == EXT2_ET_BAD_MAGIC) {
++ /* Do nothing, return silently */
++ return 1;
++ } else {
++ fprintf(stderr, "%s: error while trying to open: %s\n",
++ program, device);
++ return -1;
++ }
++ }
++
++ /* Stop if it is mounted */
++ retval = ext2fs_check_if_mounted(device, &mount_flags);
++ if (retval) {
++ fprintf(stderr, "%s: ext2fs_check_if_mount() error on %s\n",
++ program, device);
++ goto fail;
++ }
++
++ if (mount_flags & EXT2_MF_MOUNTED) {
++ fprintf(stderr, "%s: %s is mounted\n", program, device);
++ goto fail;
++ }
++
++ e2fs->default_bitmap_type = EXT2FS_BMAP64_RBTREE;
++
++ /* Read the inode map */
++ retval = ext2fs_read_inode_bitmap(e2fs);
++ if (retval) {
++ fprintf(stderr, "%s: while reading inode bitmap: %s\n",
++ program, device);
++ goto fail;
++ }
++
++ /* Read the block map */
++ retval = ext2fs_read_block_bitmap(e2fs);
++ if (retval) {
++ fprintf(stderr, "%s: while reading block bitmap: %s\n",
++ program, device);
++ goto fail;
++ }
++
++ root = cwd = EXT2_ROOT_INO;
++ /* Check the subdir */
++ if (strcmp(subdir, "/")) {
++ retval = ext2fs_namei(e2fs, root, cwd, subdir, &dirino);
++ if (retval) {
++ fprintf(stderr, "%s: failed to find dir %s on %s\n",
++ program, subdir, device);
++ goto fail;
++ }
++
++ retval = ext2fs_check_directory(e2fs, dirino);
++ if (retval) {
++ fprintf(stderr, "%s: failed to cd to: %s\n", program, subdir);
++ goto fail;
++ }
++ cwd = dirino;
++ }
++
++ return 0;
++
++fail:
++ (void) ext2fs_close(e2fs);
++ return -1;
+ }
+
+ /* The install func for ext2, ext3 and ext4 */
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch
new file mode 100644
index 000000000..84ba10526
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch
@@ -0,0 +1,116 @@
+From 64d856b243812907068776b204a003a3a8fa122a Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:17:42 +0800
+Subject: [PATCH 3/9] linux/syslinux: implement install_to_ext2()
+
+* The handle_adv_on_ext() checks whether we only need update adv.
+* The write_to_ext() installs files (ldlinux.sys or ldlinux.c32) to the
+ device.
+* The install_bootblock() installs the boot block.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 79 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index cc4e7da..45f080d 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -346,11 +346,90 @@ static int open_ext2_fs(const char *device, const char *subdir)
+ fail:
+ (void) ext2fs_close(e2fs);
+ return -1;
++
++}
++
++/*
++ * Install the boot block on the specified device.
++ * Must be run AFTER file installed.
++ */
++int install_bootblock(int fd, const char *device)
++{
++}
++
++static int handle_adv_on_ext(void)
++{
++}
++
++/* Write files, adv, boot sector */
++static int write_to_ext(const char *filename, const char *str, int length,
++ int i_flags, int dev_fd, const char *subdir)
++{
+ }
+
+ /* The install func for ext2, ext3 and ext4 */
+ static int install_to_ext2(const char *device, int dev_fd, const char *subdir)
+ {
++ int retval;
++ ext2_ino_t oldino;
++
++ const char *file = "ldlinux.sys";
++ const char *oldfile = "extlinux.sys";
++ const char *c32file = "ldlinux.c32";
++
++ /* Handle the adv */
++ if (handle_adv_on_ext() < 0) {
++ fprintf(stderr, "%s: error while handling ADV on %s\n",
++ program, device);
++ retval = 1;
++ goto fail;
++ }
++
++ /* Return if only need update the adv */
++ if (opt.update_only == -1) {
++ return ext2fs_close(e2fs);
++ }
++
++ /* Write ldlinux.sys, adv, boot sector */
++ retval = write_to_ext(file, (const char _force *)boot_image,
++ boot_image_len, EXT2_IMMUTABLE_FL, dev_fd, subdir);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: while writing: %s.\n",
++ program, file);
++ goto fail;
++ }
++
++ /* Write ldlinux.c32 */
++ retval = write_to_ext(c32file,
++ (const char _force *)syslinux_ldlinuxc32,
++ syslinux_ldlinuxc32_len, 0, dev_fd, subdir);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: while writing: %s.\n",
++ program, c32file);
++ goto fail;
++ }
++
++ /* Look if we have the extlinux.sys and remove it*/
++ retval = ext2fs_namei(e2fs, root, cwd, oldfile, &oldino);
++ if (retval == 0) {
++ retval = ext2fs_unlink(e2fs, cwd, oldfile, oldino, 0);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: failed to unlink: %s\n",
++ program, oldfile);
++ goto fail;
++ }
++ } else {
++ retval = 0;
++ }
++
++ sync();
++ retval = install_bootblock(dev_fd, device);
++ close(dev_fd);
++ sync();
++
++fail:
++ (void) ext2fs_close(e2fs);
++ return retval;
+ }
+
+ int main(int argc, char *argv[])
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch
new file mode 100644
index 000000000..64b56d92e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch
@@ -0,0 +1,91 @@
+From 35d3842cc4b930c5102eed2921e0189b7f4fd069 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:43:37 +0800
+Subject: [PATCH 4/9] linux/syslinux: add ext_file_read() and ext_file_write()
+
+Will use them to read and write on the extX device.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 62 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index 45f080d..247c86a 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -349,6 +349,68 @@ fail:
+
+ }
+
++/* Read from an ext2_file */
++static int ext_file_read(ext2_file_t e2_file, void *buf, size_t count,
++ off_t offset, const char *msg)
++{
++ int retval;
++ char *ptr = (char *) buf;
++ unsigned int got = 0;
++ size_t done = 0;
++
++ /* Always lseek since e2_file is uncontrolled by this func */
++ if (ext2fs_file_lseek(e2_file, offset, EXT2_SEEK_SET, NULL)) {
++ fprintf(stderr, "%s: ext2fs_file_lseek() failed.\n",
++ program);
++ return -1;
++ }
++
++ while (1) {
++ retval = ext2fs_file_read(e2_file, ptr, count, &got);
++ if (retval) {
++ fprintf(stderr, "%s: error while reading %s\n",
++ program, msg);
++ return -1;
++ }
++ count -= got;
++ ptr += got;
++ done += got;
++ if (got == 0 || count == 0)
++ break;
++ }
++
++ return done;
++}
++
++/* Write to an ext2_file */
++static int ext_file_write(ext2_file_t e2_file, const void *buf, size_t count,
++ off_t offset)
++{
++ const char *ptr = (const char *) buf;
++ unsigned int written = 0;
++ size_t done = 0;
++
++ /* Always lseek since e2_file is uncontrolled by this func */
++ if (ext2fs_file_lseek(e2_file, offset, EXT2_SEEK_SET, NULL)) {
++ fprintf(stderr, "%s: ext2fs_file_lseek() failed.\n",
++ program);
++ return -1;
++ }
++
++ while (count > 0) {
++ if (ext2fs_file_write(e2_file, ptr, count, &written)) {
++ fprintf(stderr, "%s: failed to write syslinux adv.\n",
++ program);
++ return -1;
++ }
++ count -= written;
++ ptr += written;
++ done += written;
++ }
++
++ return done;
++}
++
+ /*
+ * Install the boot block on the specified device.
+ * Must be run AFTER file installed.
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch
new file mode 100644
index 000000000..829e7c4ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch
@@ -0,0 +1,127 @@
+From cdb980b37f40dc2c41891434c7736e49da53756e Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:47:52 +0800
+Subject: [PATCH 5/9] linux/syslinux: implement handle_adv_on_ext()
+
+It reads adv if found on the device, or resets syslinux_adv, or update
+the adv if update adv only.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 97 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index 247c86a..de5d272 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -421,6 +421,103 @@ int install_bootblock(int fd, const char *device)
+
+ static int handle_adv_on_ext(void)
+ {
++ int i, retval, found_file;
++ int need_close = 2; /* 2 means no need extra close */
++ char *filenames[2] = {"ldlinux.sys", "extlinux.sys"};
++ char *filename;
++ ext2_ino_t newino;
++ ext2_file_t e2_file;
++ struct ext2_inode inode;
++
++ for (i = 0; i < 2; i++) {
++ filename = filenames[i];
++ found_file = 0;
++ retval = ext2fs_namei(e2fs, root, cwd, filename, &newino);
++ if (retval == 0) {
++ found_file = 1;
++ } else
++ continue;
++
++ need_close = i;
++
++ retval = ext2fs_file_open(e2fs, newino, EXT2_FLAG_RW, &e2_file);
++ if (retval) {
++ fprintf(stderr, "%s: failed to open %s\n",
++ program, filename);
++ goto fail;
++ }
++
++ retval = ext2fs_read_inode(e2fs, newino, &inode);
++ if (retval) {
++ fprintf(stderr, "%s: error while reading inode: %u, file: %s\n",
++ program, newino, filename);
++ goto fail;
++ }
++
++ /* Check the size to see if too small to read */
++ if (inode.i_size < 2 * ADV_SIZE) {
++ if (opt.update_only == -1) {
++ fprintf(stderr, "%s: failed to write auxilliary data\n\
++ the size of %s is too small (need --update)?\n",
++ program, filename);
++ retval = -1;
++ goto fail;
++ }
++ syslinux_reset_adv(syslinux_adv);
++ found_file = 0;
++ break;
++ }
++
++ /* Read the adv */
++ retval = ext_file_read(e2_file, syslinux_adv, 2 * ADV_SIZE,
++ inode.i_size - 2 * ADV_SIZE, "ADV");
++ if (retval == -1)
++ goto fail;
++ if (retval == 2 * ADV_SIZE) {
++ retval = syslinux_validate_adv(syslinux_adv);
++ /* Read the adv successfully */
++ if (retval == 0)
++ break;
++ }
++
++ /* Close the file if reaches here, otherwise we leave the file
++ * open in case we need write it */
++ need_close = 2;
++ retval = ext2fs_file_close(e2_file);
++ if (retval) {
++ fprintf(stderr, "%s: error while closing %s\n",
++ program, filename);
++ return retval;
++ }
++ }
++
++ if (!found_file) {
++ if (opt.update_only == -1) {
++ fprintf(stderr, "%s: no ldlinux.sys or extlinux.sys found on the device\n",
++ program);
++ return -1;
++ }
++ syslinux_reset_adv(syslinux_adv);
++ }
++
++ /* The modify_adv will reset the adv if opt.reset_adv */
++ if (modify_adv() < 0) {
++ fprintf(stderr, "%s: error while modifying adv\n", program);
++ retval = -1;
++ goto fail;
++ }
++
++ /* Write adv if update_only == -1 and found file */
++ if (opt.update_only == -1 && found_file) {
++ if (ext_file_write(e2_file, syslinux_adv, 2 * ADV_SIZE ,
++ inode.i_size - 2 * ADV_SIZE) == -1)
++ goto fail;
++ }
++
++fail:
++ if (need_close != 2)
++ (void) ext2fs_file_close(e2_file);
++ return retval;
+ }
+
+ /* Write files, adv, boot sector */
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch
new file mode 100644
index 000000000..cba87252a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch
@@ -0,0 +1,215 @@
+From 922e56c10e36d876777580c84daef9a66bea6525 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 17:20:43 +0800
+Subject: [PATCH 6/9] linux/syslinux: implement write_to_ext() and add
+ syslinuxext.c
+
+* The write_to_ext() write file to the extX device, and handle the boot
+ sector.
+* The syslinuxext.c is used for placing the code which are used by
+ extlinux and syslinux (which is syslinux_patch_bootsect()).
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ libinstaller/syslinuxext.c | 7 +++
+ libinstaller/syslinuxext.h | 5 ++
+ linux/Makefile | 3 +-
+ linux/syslinux.c | 118 +++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 132 insertions(+), 1 deletion(-)
+ create mode 100644 libinstaller/syslinuxext.c
+ create mode 100644 libinstaller/syslinuxext.h
+
+diff --git a/libinstaller/syslinuxext.c b/libinstaller/syslinuxext.c
+new file mode 100644
+index 0000000..bb54cef
+--- /dev/null
++++ b/libinstaller/syslinuxext.c
+@@ -0,0 +1,7 @@
++#define _GNU_SOURCE
++
++/* Patch syslinux_bootsect */
++void syslinux_patch_bootsect(int dev_fd)
++{
++}
++
+diff --git a/libinstaller/syslinuxext.h b/libinstaller/syslinuxext.h
+new file mode 100644
+index 0000000..8abd8b9
+--- /dev/null
++++ b/libinstaller/syslinuxext.h
+@@ -0,0 +1,5 @@
++#ifndef EXT2_SUPER_OFFSET
++#define EXT2_SUPER_OFFSET 1024
++#endif
++
++void syslinux_patch_bootsect(int dev_fd);
+diff --git a/linux/Makefile b/linux/Makefile
+index ac1ac58..3b23867 100644
+--- a/linux/Makefile
++++ b/linux/Makefile
+@@ -30,7 +30,8 @@ SRCS = syslinux.c \
+ ../libinstaller/syslxmod.c \
+ ../libinstaller/bootsect_bin.c \
+ ../libinstaller/ldlinuxc32_bin.c \
+- ../libinstaller/ldlinux_bin.c
++ ../libinstaller/ldlinux_bin.c \
++ ../libinstaller/syslinuxext.c
+ OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
+
+ .SUFFIXES: .c .o .i .s .S
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index de5d272..f0c97a8 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -46,6 +46,7 @@
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <sys/mount.h>
++#include <time.h>
+
+ #include "linuxioctl.h"
+
+@@ -72,6 +73,7 @@
+ #include "syslxfs.h"
+ #include "setadv.h"
+ #include "syslxopt.h" /* unified options */
++#include "syslinuxext.h"
+ #include <ext2fs/ext2fs.h>
+
+ extern const char *program; /* Name of program */
+@@ -419,6 +421,12 @@ int install_bootblock(int fd, const char *device)
+ {
+ }
+
++/* Construct the boot file map */
++int ext_construct_sectmap_fs(ext2_filsys fs, ext2_ino_t newino,
++ sector_t *sectors, int nsect)
++{
++}
++
+ static int handle_adv_on_ext(void)
+ {
+ int i, retval, found_file;
+@@ -524,6 +532,116 @@ fail:
+ static int write_to_ext(const char *filename, const char *str, int length,
+ int i_flags, int dev_fd, const char *subdir)
+ {
++ ext2_ino_t newino;
++ struct ext2_inode inode;
++ int retval, i, modbytes, nsect;
++ ext2_file_t e2_file;
++ sector_t *sectors;
++
++ /* Remove it if it is already exists */
++ retval = ext2fs_namei(e2fs, root, cwd, filename, &newino);
++ if (retval == 0) {
++ retval = ext2fs_unlink(e2fs, cwd, filename, newino, 0);
++ if (retval) {
++ fprintf(stderr, "%s: failed to unlink: %s\n", program, filename);
++ return retval;
++ }
++ }
++
++ /* Create new inode */
++ retval = ext2fs_new_inode(e2fs, cwd, 010755, 0, &newino);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: failed to create inode for: %s\n",
++ program, filename);
++ return retval;
++ }
++
++ /* Link the inode and the filename */
++ retval = ext2fs_link(e2fs, cwd, filename, newino, EXT2_FT_REG_FILE);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: failed to link inode for: %s.\n",
++ program, filename);
++ return retval;
++ }
++
++ if (ext2fs_test_inode_bitmap2(e2fs->inode_map, newino))
++ fprintf(stderr, "%s: warning: inode already set %s.\n",
++ program, filename);
++
++ ext2fs_inode_alloc_stats2(e2fs, newino, +1, 0);
++ memset(&inode, 0, sizeof(inode));
++ inode.i_mode = LINUX_S_IFREG | LINUX_S_IRUSR | LINUX_S_IRGRP
++ | LINUX_S_IROTH;
++ inode.i_flags |= i_flags;
++ inode.i_atime = inode.i_ctime = inode.i_mtime =
++ e2fs->now ? e2fs->now : time(0);
++ inode.i_links_count = 1;
++ if (e2fs->super->s_feature_incompat &
++ EXT3_FEATURE_INCOMPAT_EXTENTS) {
++ struct ext3_extent_header *eh;
++
++ eh = (struct ext3_extent_header *) &inode.i_block[0];
++ eh->eh_depth = 0;
++ eh->eh_entries = 0;
++ eh->eh_magic = ext2fs_cpu_to_le16(EXT3_EXT_MAGIC);
++ i = (sizeof(inode.i_block) - sizeof(*eh)) /
++ sizeof(struct ext3_extent);
++ eh->eh_max = ext2fs_cpu_to_le16(i);
++ inode.i_flags |= EXT4_EXTENTS_FL;
++ }
++
++ retval = ext2fs_write_new_inode(e2fs, newino, &inode);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: while writting inode %d.\n",
++ program, newino);
++ return 1;
++ }
++
++ retval = ext2fs_file_open(e2fs, newino, EXT2_FILE_WRITE, &e2_file);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: failed to open %s.\n",
++ program, filename);
++ return 1;
++ }
++
++ /* Write to file */
++ if (ext_file_write(e2_file, str, length, 0) == -1)
++ goto fail;
++
++ if (strcmp(filename, "ldlinux.sys") == 0) {
++ /* Write ADV */
++ if (ext_file_write(e2_file, syslinux_adv, 2 * ADV_SIZE,
++ boot_image_len) == -1)
++ goto fail;
++
++ /* Patch syslinux_bootsect */
++ syslinux_patch_bootsect(dev_fd);
++
++ /* Patch ldlinux.sys */
++ nsect = (boot_image_len + SECTOR_SIZE - 1) >> SECTOR_SHIFT;
++ nsect += 2; /* Two sectors for the ADV */
++ sectors = alloca(sizeof(sector_t) * nsect);
++ memset(sectors, 0, nsect * sizeof *sectors);
++ /* The sectors will be modified and used by syslinux_patch() */
++ retval = ext_construct_sectmap_fs(e2fs, newino, sectors, nsect);
++ if (retval)
++ goto fail;
++
++ /* Create the modified image in memory */
++ modbytes = syslinux_patch(sectors, nsect, opt.stupid_mode,
++ opt.raid_mode, subdir, NULL);
++
++ /* Rewrite the first modbytes of ldlinux.sys */
++ if (ext_file_write(e2_file, str, modbytes, 0) == -1) {
++ fprintf(stderr, "%s: ERROR: failed to patch %s.\n", program,
++ filename);
++ goto fail;
++ }
++ }
++
++fail:
++ (void) ext2fs_file_close(e2_file);
++ return retval;
+ }
+
+ /* The install func for ext2, ext3 and ext4 */
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch
new file mode 100644
index 000000000..391381191
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch
@@ -0,0 +1,84 @@
+From a95b831e18dd123f859bc5e6c4cecdcc0184ee37 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 2 Jan 2015 12:18:02 +0800
+Subject: [PATCH 7/9] linux/syslinux: implement ext_construct_sectmap_fs()
+
+The ext_construct_sectmap_fs() constucts the sector according to the
+bmap.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 50 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index f0c97a8..c741750 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -421,10 +421,60 @@ int install_bootblock(int fd, const char *device)
+ {
+ }
+
++/* The file's block count */
++int block_count = 0;
++static int get_block_count(ext2_filsys fs EXT2FS_ATTR((unused)),
++ blk64_t *blocknr EXT2FS_ATTR((unused)),
++ e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)),
++ blk64_t ref_block EXT2FS_ATTR((unused)),
++ int ref_offset EXT2FS_ATTR((unused)),
++ void *private EXT2FS_ATTR((unused)))
++{
++ block_count++;
++ return 0;
++}
++
+ /* Construct the boot file map */
+ int ext_construct_sectmap_fs(ext2_filsys fs, ext2_ino_t newino,
+ sector_t *sectors, int nsect)
+ {
++ blk64_t pblk, blksize, blk = 0;
++ sector_t sec;
++ unsigned int i;
++ int retval;
++
++ blksize = fs->blocksize;
++ blksize >>= SECTOR_SHIFT;
++
++ /* Get the total blocks no. */
++ retval = ext2fs_block_iterate3(fs, newino, BLOCK_FLAG_READ_ONLY,
++ NULL, get_block_count, NULL);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: ext2fs_block_iterate3() failed.\n", program);
++ return -1;
++ }
++
++ while (nsect) {
++ if (block_count-- == 0)
++ break;
++
++ /* Get the physical block no. (bmap) */
++ retval = ext2fs_bmap2(fs, newino, 0, 0, 0, blk, 0, &pblk);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: ext2fs_bmap2() failed.\n", program);
++ return -1;
++ }
++
++ blk++;
++ sec = (sector_t)pblk * blksize;
++ for (i = 0; i < blksize; i++) {
++ *sectors++ = sec++;
++ if (! --nsect)
++ break;
++ }
++ }
++
++ return 0;
+ }
+
+ static int handle_adv_on_ext(void)
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch
new file mode 100644
index 000000000..2400c98d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch
@@ -0,0 +1,427 @@
+From 78d76b87a4b855e6b661ae457283a63f385c04c9 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 2 Jan 2015 12:26:46 +0800
+Subject: [PATCH 8/9] libinstaller/syslinuxext: implement
+ syslinux_patch_bootsect()
+
+Move the related from extlinux/main.c to libinstaller/syslinuxext.c, the
+syslinux_patch_bootsect() are used by both extlinux/main.c and
+linux/syslinux.c.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ extlinux/Makefile | 3 +-
+ extlinux/main.c | 167 +-------------------------------------------
+ libinstaller/syslinuxext.c | 170 +++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 175 insertions(+), 165 deletions(-)
+
+diff --git a/extlinux/Makefile b/extlinux/Makefile
+index 02d1db5..90dd92f 100644
+--- a/extlinux/Makefile
++++ b/extlinux/Makefile
+@@ -31,7 +31,8 @@ SRCS = main.c \
+ ../libinstaller/advio.c \
+ ../libinstaller/bootsect_bin.c \
+ ../libinstaller/ldlinuxc32_bin.c \
+- ../libinstaller/ldlinux_bin.c
++ ../libinstaller/ldlinux_bin.c \
++ ../libinstaller/syslinuxext.c
+ OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
+
+ .SUFFIXES: .c .o .i .s .S
+diff --git a/extlinux/main.c b/extlinux/main.c
+index 09740bd..6fe026e 100644
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -60,6 +60,7 @@
+ #include "setadv.h"
+ #include "syslxopt.h" /* unified options */
+ #include "mountinfo.h"
++#include "syslinuxext.h"
+
+ #ifdef DEBUG
+ # define dprintf printf
+@@ -67,10 +68,6 @@
+ # define dprintf(...) ((void)0)
+ #endif
+
+-#ifndef EXT2_SUPER_OFFSET
+-#define EXT2_SUPER_OFFSET 1024
+-#endif
+-
+ /* Since we have unused 2048 bytes in the primary AG of an XFS partition,
+ * we will use the first 0~512 bytes starting from 2048 for the Syslinux
+ * boot sector.
+@@ -92,136 +89,6 @@ static char subvol[BTRFS_SUBVOL_MAX];
+ - 2*ADV_SIZE)
+
+ /*
+- * Get the size of a block device
+- */
+-static uint64_t get_size(int devfd)
+-{
+- uint64_t bytes;
+- uint32_t sects;
+- struct stat st;
+-
+-#ifdef BLKGETSIZE64
+- if (!ioctl(devfd, BLKGETSIZE64, &bytes))
+- return bytes;
+-#endif
+- if (!ioctl(devfd, BLKGETSIZE, &sects))
+- return (uint64_t) sects << 9;
+- else if (!fstat(devfd, &st) && st.st_size)
+- return st.st_size;
+- else
+- return 0;
+-}
+-
+-/*
+- * Get device geometry and partition offset
+- */
+-struct geometry_table {
+- uint64_t bytes;
+- struct hd_geometry g;
+-};
+-
+-static int sysfs_get_offset(int devfd, unsigned long *start)
+-{
+- struct stat st;
+- char sysfs_name[128];
+- FILE *f;
+- int rv;
+-
+- if (fstat(devfd, &st))
+- return -1;
+-
+- if ((size_t)snprintf(sysfs_name, sizeof sysfs_name,
+- "/sys/dev/block/%u:%u/start",
+- major(st.st_rdev), minor(st.st_rdev))
+- >= sizeof sysfs_name)
+- return -1;
+-
+- f = fopen(sysfs_name, "r");
+- if (!f)
+- return -1;
+-
+- rv = fscanf(f, "%lu", start);
+- fclose(f);
+-
+- return (rv == 1) ? 0 : -1;
+-}
+-
+-/* Standard floppy disk geometries, plus LS-120. Zipdisk geometry
+- (x/64/32) is the final fallback. I don't know what LS-240 has
+- as its geometry, since I don't have one and don't know anyone that does,
+- and Google wasn't helpful... */
+-static const struct geometry_table standard_geometries[] = {
+- {360 * 1024, {2, 9, 40, 0}},
+- {720 * 1024, {2, 9, 80, 0}},
+- {1200 * 1024, {2, 15, 80, 0}},
+- {1440 * 1024, {2, 18, 80, 0}},
+- {1680 * 1024, {2, 21, 80, 0}},
+- {1722 * 1024, {2, 21, 80, 0}},
+- {2880 * 1024, {2, 36, 80, 0}},
+- {3840 * 1024, {2, 48, 80, 0}},
+- {123264 * 1024, {8, 32, 963, 0}}, /* LS120 */
+- {0, {0, 0, 0, 0}}
+-};
+-
+-int get_geometry(int devfd, uint64_t totalbytes, struct hd_geometry *geo)
+-{
+- struct floppy_struct fd_str;
+- struct loop_info li;
+- struct loop_info64 li64;
+- const struct geometry_table *gp;
+- int rv = 0;
+-
+- memset(geo, 0, sizeof *geo);
+-
+- if (!ioctl(devfd, HDIO_GETGEO, geo)) {
+- goto ok;
+- } else if (!ioctl(devfd, FDGETPRM, &fd_str)) {
+- geo->heads = fd_str.head;
+- geo->sectors = fd_str.sect;
+- geo->cylinders = fd_str.track;
+- geo->start = 0;
+- goto ok;
+- }
+-
+- /* Didn't work. Let's see if this is one of the standard geometries */
+- for (gp = standard_geometries; gp->bytes; gp++) {
+- if (gp->bytes == totalbytes) {
+- memcpy(geo, &gp->g, sizeof *geo);
+- goto ok;
+- }
+- }
+-
+- /* Didn't work either... assign a geometry of 64 heads, 32 sectors; this is
+- what zipdisks use, so this would help if someone has a USB key that
+- they're booting in USB-ZIP mode. */
+-
+- geo->heads = opt.heads ? : 64;
+- geo->sectors = opt.sectors ? : 32;
+- geo->cylinders = totalbytes / (geo->heads * geo->sectors << SECTOR_SHIFT);
+- geo->start = 0;
+-
+- if (!opt.sectors && !opt.heads) {
+- fprintf(stderr,
+- "Warning: unable to obtain device geometry (defaulting to %d heads, %d sectors)\n"
+- " (on hard disks, this is usually harmless.)\n",
+- geo->heads, geo->sectors);
+- rv = 1; /* Suboptimal result */
+- }
+-
+-ok:
+- /* If this is a loopback device, try to set the start */
+- if (!ioctl(devfd, LOOP_GET_STATUS64, &li64))
+- geo->start = li64.lo_offset >> SECTOR_SHIFT;
+- else if (!ioctl(devfd, LOOP_GET_STATUS, &li))
+- geo->start = (unsigned int)li.lo_offset >> SECTOR_SHIFT;
+- else if (!sysfs_get_offset(devfd, &geo->start)) {
+- /* OK */
+- }
+-
+- return rv;
+-}
+-
+-/*
+ * Query the device geometry and put it into the boot sector.
+ * Map the file and put the map in the boot sector and file.
+ * Stick the "current directory" inode number into the file.
+@@ -231,11 +98,8 @@ ok:
+ static int patch_file_and_bootblock(int fd, const char *dir, int devfd)
+ {
+ struct stat dirst, xdst;
+- struct hd_geometry geo;
+ sector_t *sectp;
+- uint64_t totalbytes, totalsectors;
+ int nsect;
+- struct fat_boot_sector *sbs;
+ char *dirpath, *subpath, *xdirpath;
+ int rv;
+
+@@ -279,33 +143,8 @@ static int patch_file_and_bootblock(int fd, const char *dir, int devfd)
+ /* Now subpath should contain the path relative to the fs base */
+ dprintf("subpath = %s\n", subpath);
+
+- totalbytes = get_size(devfd);
+- get_geometry(devfd, totalbytes, &geo);
+-
+- if (opt.heads)
+- geo.heads = opt.heads;
+- if (opt.sectors)
+- geo.sectors = opt.sectors;
+-
+- /* Patch this into a fake FAT superblock. This isn't because
+- FAT is a good format in any way, it's because it lets the
+- early bootstrap share code with the FAT version. */
+- dprintf("heads = %u, sect = %u\n", geo.heads, geo.sectors);
+-
+- sbs = (struct fat_boot_sector *)syslinux_bootsect;
+-
+- totalsectors = totalbytes >> SECTOR_SHIFT;
+- if (totalsectors >= 65536) {
+- set_16(&sbs->bsSectors, 0);
+- } else {
+- set_16(&sbs->bsSectors, totalsectors);
+- }
+- set_32(&sbs->bsHugeSectors, totalsectors);
+-
+- set_16(&sbs->bsBytesPerSec, SECTOR_SIZE);
+- set_16(&sbs->bsSecPerTrack, geo.sectors);
+- set_16(&sbs->bsHeads, geo.heads);
+- set_32(&sbs->bsHiddenSecs, geo.start);
++ /* Patch syslinux_bootsect */
++ syslinux_patch_bootsect(devfd);
+
+ /* Construct the boot file map */
+
+diff --git a/libinstaller/syslinuxext.c b/libinstaller/syslinuxext.c
+index bb54cef..5a4423b 100644
+--- a/libinstaller/syslinuxext.c
++++ b/libinstaller/syslinuxext.c
+@@ -1,7 +1,177 @@
+ #define _GNU_SOURCE
+
++#include <sys/stat.h>
++#include <sys/types.h>
++#include <getopt.h>
++#include <ext2fs/ext2fs.h>
++
++#include "linuxioctl.h"
++#include "syslinux.h"
++#include "syslxint.h"
++#include "syslxopt.h"
++
++/*
++ * Get the size of a block device
++ */
++static uint64_t get_size(int dev_fd)
++{
++ uint64_t bytes;
++ uint32_t sects;
++ struct stat st;
++
++#ifdef BLKGETSIZE64
++ if (!ioctl(dev_fd, BLKGETSIZE64, &bytes))
++ return bytes;
++#endif
++ if (!ioctl(dev_fd, BLKGETSIZE, &sects))
++ return (uint64_t) sects << 9;
++ else if (!fstat(dev_fd, &st) && st.st_size)
++ return st.st_size;
++ else
++ return 0;
++}
++
++/*
++ * Get device geometry and partition offset
++ */
++static struct geometry_table {
++ uint64_t bytes;
++ struct hd_geometry g;
++};
++
++static int sysfs_get_offset(int dev_fd, unsigned long *start)
++{
++ struct stat st;
++ char sysfs_name[128];
++ FILE *f;
++ int rv;
++
++ if (fstat(dev_fd, &st))
++ return -1;
++
++ if ((size_t)snprintf(sysfs_name, sizeof sysfs_name,
++ "/sys/dev/block/%u:%u/start",
++ major(st.st_rdev), minor(st.st_rdev))
++ >= sizeof sysfs_name)
++ return -1;
++
++ f = fopen(sysfs_name, "r");
++ if (!f)
++ return -1;
++
++ rv = fscanf(f, "%lu", start);
++ fclose(f);
++
++ return (rv == 1) ? 0 : -1;
++}
++
++/* Standard floppy disk geometries, plus LS-120. Zipdisk geometry
++ (x/64/32) is the final fallback. I don't know what LS-240 has
++ as its geometry, since I don't have one and don't know anyone that does,
++ and Google wasn't helpful... */
++static const struct geometry_table standard_geometries[] = {
++ {360 * 1024, {2, 9, 40, 0}},
++ {720 * 1024, {2, 9, 80, 0}},
++ {1200 * 1024, {2, 15, 80, 0}},
++ {1440 * 1024, {2, 18, 80, 0}},
++ {1680 * 1024, {2, 21, 80, 0}},
++ {1722 * 1024, {2, 21, 80, 0}},
++ {2880 * 1024, {2, 36, 80, 0}},
++ {3840 * 1024, {2, 48, 80, 0}},
++ {123264 * 1024, {8, 32, 963, 0}}, /* LS120 */
++ {0, {0, 0, 0, 0}}
++};
++
++static int get_geometry(int dev_fd, uint64_t totalbytes, struct hd_geometry *geo)
++{
++ struct floppy_struct fd_str;
++ struct loop_info li;
++ struct loop_info64 li64;
++ const struct geometry_table *gp;
++ int rv = 0;
++
++ memset(geo, 0, sizeof *geo);
++
++ if (!ioctl(dev_fd, HDIO_GETGEO, geo)) {
++ goto ok;
++ } else if (!ioctl(dev_fd, FDGETPRM, &fd_str)) {
++ geo->heads = fd_str.head;
++ geo->sectors = fd_str.sect;
++ geo->cylinders = fd_str.track;
++ geo->start = 0;
++ goto ok;
++ }
++
++ /* Didn't work. Let's see if this is one of the standard geometries */
++ for (gp = standard_geometries; gp->bytes; gp++) {
++ if (gp->bytes == totalbytes) {
++ memcpy(geo, &gp->g, sizeof *geo);
++ goto ok;
++ }
++ }
++
++ /* Didn't work either... assign a geometry of 64 heads, 32 sectors; this is
++ what zipdisks use, so this would help if someone has a USB key that
++ they're booting in USB-ZIP mode. */
++
++ geo->heads = opt.heads ? : 64;
++ geo->sectors = opt.sectors ? : 32;
++ geo->cylinders = totalbytes / (geo->heads * geo->sectors << SECTOR_SHIFT);
++ geo->start = 0;
++
++ if (!opt.sectors && !opt.heads) {
++ fprintf(stderr,
++ "Warning: unable to obtain device geometry (defaulting to %d heads, %d sectors)\n"
++ " (on hard disks, this is usually harmless.)\n",
++ geo->heads, geo->sectors);
++ rv = 1; /* Suboptimal result */
++ }
++
++ok:
++ /* If this is a loopback device, try to set the start */
++ if (!ioctl(dev_fd, LOOP_GET_STATUS64, &li64))
++ geo->start = li64.lo_offset >> SECTOR_SHIFT;
++ else if (!ioctl(dev_fd, LOOP_GET_STATUS, &li))
++ geo->start = (unsigned int)li.lo_offset >> SECTOR_SHIFT;
++ else if (!sysfs_get_offset(dev_fd, &geo->start)) {
++ /* OK */
++ }
++
++ return rv;
++}
++
++
+ /* Patch syslinux_bootsect */
+ void syslinux_patch_bootsect(int dev_fd)
+ {
++ uint64_t totalbytes, totalsectors;
++ struct hd_geometry geo;
++ struct fat_boot_sector *sbs;
++
++ totalbytes = get_size(dev_fd);
++ get_geometry(dev_fd, totalbytes, &geo);
++
++ if (opt.heads)
++ geo.heads = opt.heads;
++ if (opt.sectors)
++ geo.sectors = opt.sectors;
++
++ /* Patch this into a fake FAT superblock. This isn't because
++ FAT is a good format in any way, it's because it lets the
++ early bootstrap share code with the FAT version. */
++ sbs = (struct fat_boot_sector *)syslinux_bootsect;
++
++ totalsectors = totalbytes >> SECTOR_SHIFT;
++ if (totalsectors >= 65536) {
++ set_16(&sbs->bsSectors, 0);
++ } else {
++ set_16(&sbs->bsSectors, totalsectors);
++ }
++ set_32(&sbs->bsHugeSectors, totalsectors);
++
++ set_16(&sbs->bsBytesPerSec, SECTOR_SIZE);
++ set_16(&sbs->bsSecPerTrack, geo.sectors);
++ set_16(&sbs->bsHeads, geo.heads);
++ set_32(&sbs->bsHiddenSecs, geo.start);
+ }
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch
new file mode 100644
index 000000000..cd89d9248
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch
@@ -0,0 +1,50 @@
+From 76c465e87312dbc6cffd05427f1f4d2ebdee4f13 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 2 Jan 2015 12:28:35 +0800
+Subject: [PATCH 9/9] linux/syslinux: implement install_bootblock()
+
+Refer to the install_bootblock() in extlinux/main.c to make
+linux/syslinux.c's install_bootblock() which only supports ext2/3/4.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index c741750..917f83a 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -419,6 +419,26 @@ static int ext_file_write(ext2_file_t e2_file, const void *buf, size_t count,
+ */
+ int install_bootblock(int fd, const char *device)
+ {
++ struct ext2_super_block sb;
++
++ if (xpread(fd, &sb, sizeof sb, EXT2_SUPER_OFFSET + opt.offset) != sizeof sb) {
++ perror("reading superblock");
++ return 1;
++ }
++
++ if (sb.s_magic != EXT2_SUPER_MAGIC) {
++ fprintf(stderr,
++ "no ext2/3/4 superblock found on %s\n", device);
++ return 1;
++ }
++
++ if (xpwrite(fd, syslinux_bootsect, syslinux_bootsect_len, 0)
++ != (signed)syslinux_bootsect_len) {
++ perror("writing bootblock");
++ return 1;
++ }
++
++ return 0;
+ }
+
+ /* The file's block count */
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0010-gcc46-compatibility.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0010-gcc46-compatibility.patch
new file mode 100644
index 000000000..6279258c2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0010-gcc46-compatibility.patch
@@ -0,0 +1,37 @@
+don't break with old compilers and -DGNU_EFI_USE_MS_ABI
+It's entirely legitimate to request GNU_EFI_USE_MS_ABI even if the current
+compiler doesn't support it, and gnu-efi should transparently fall back to
+using legacy techniques to set the calling convention. We don't get type
+checking, but at least it will still compile.
+
+Adapted from gnu-efi
+
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Upstream-Status: Pending
+
+Index: syslinux-6.03/efi64/include/efi/x86_64/efibind.h
+===================================================================
+--- syslinux-6.03.orig/efi64/include/efi/x86_64/efibind.h
++++ syslinux-6.03/efi64/include/efi/x86_64/efibind.h
+@@ -25,8 +25,6 @@ Revision History
+ #if defined(GNU_EFI_USE_MS_ABI)
+ #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
+ #define HAVE_USE_MS_ABI 1
+- #else
+- #error Compiler is too old for GNU_EFI_USE_MS_ABI
+ #endif
+ #endif
+
+Index: syslinux-6.03/gnu-efi/gnu-efi-3.0/inc/x86_64/efibind.h
+===================================================================
+--- syslinux-6.03.orig/gnu-efi/gnu-efi-3.0/inc/x86_64/efibind.h
++++ syslinux-6.03/gnu-efi/gnu-efi-3.0/inc/x86_64/efibind.h
+@@ -25,8 +25,6 @@ Revision History
+ #if defined(GNU_EFI_USE_MS_ABI)
+ #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
+ #define HAVE_USE_MS_ABI 1
+- #else
+- #error Compiler is too old for GNU_EFI_USE_MS_ABI
+ #endif
+ #endif
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0011-mk-MMD-does-not-take-any-arguments.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0011-mk-MMD-does-not-take-any-arguments.patch
new file mode 100644
index 000000000..443c1ccc5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/0011-mk-MMD-does-not-take-any-arguments.patch
@@ -0,0 +1,33 @@
+From 0f3d83c25491951f1fa84c7957358ef3d1bcd8a9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Sep 2015 17:39:22 +0000
+Subject: [PATCH] mk: -MMD does not take any arguments
+
+Specify -Wp for each option, clang seems to not accept
+-Wp,-x,y,-a,b
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ mk/syslinux.mk | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: syslinux-6.03/mk/syslinux.mk
+===================================================================
+--- syslinux-6.03.orig/mk/syslinux.mk
++++ syslinux-6.03/mk/syslinux.mk
+@@ -82,11 +82,11 @@ ARCH ?= $(strip $(SUBARCH))
+ GCCWARN = -W -Wall -Wstrict-prototypes $(DEBUGOPT)
+
+ # Common stanza to make gcc generate .*.d dependency files
+-MAKEDEPS = -Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d
++MAKEDEPS = -MT $@ -MD
+
+ # Dependencies that exclude system headers; use whenever we use
+ # header files from the platform.
+-UMAKEDEPS = -Wp,-MT,$@,-MMD,$(dir $@).$(notdir $@).d
++UMAKEDEPS = -MT $@ -MMD
+
+ # Items that are only appropriate during development; this file is
+ # removed when tarballs are generated.
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch
new file mode 100644
index 000000000..312b1e8ae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch
@@ -0,0 +1,35 @@
+syslinux-native: fix parallel building issue
+
+There might be an error when parallel build:
+
+[snip]
+cp: cannot create directory `tmp/sysroots/x86_64-linux/usr/share/
+syslinux/com32/include/gplinclude': No such file or directory
+make[4]: *** [install] Error 1
+make[3]: *** [gpllib] Error 2
+[snip]
+
+This is a potential issue. In ${S}/com32/gpllib/Makefile file,
+install target wants to copy $(SRC)/../gplinclude to
+$(INSTALLROOT)$(COM32DIR)/include/ directory, but in ${S}/com32/lib/Makefile
+file, the install target will remove $(INSTALLROOT)$(COM32DIR)/include
+directory. We need to do com32/lib first.
+
+The patch make com32/gpllib depends on com32/lib to fix this issue.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ com32/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: syslinux-6.03/com32/Makefile
+===================================================================
+--- syslinux-6.03.orig/com32/Makefile
++++ syslinux-6.03/com32/Makefile
+@@ -21,3 +21,4 @@ rosh: lib libutil
+ samples: libutil elflink/ldlinux
+ sysdump: lib libutil libupload gpllib
+ lua/src: cmenu modules
++gpllib: lib
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch
new file mode 100644
index 000000000..c0714b517
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch
@@ -0,0 +1,34 @@
+From 490fc3bbd65c2c252c1fdf3da0fac9898aa9eea6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 15 Aug 2014 21:09:16 -0700
+Subject: [PATCH] com32/Makefile: fix parallel issue
+
+Fixed:
+cp -r syslinux-6.01/com32/libupload/*.h image/usr/share/syslinux/com32/include/
+[snip]
+rm -rf image/usr/share/syslinux/com32/include
+[snip]
+cp: cannot create regular file `image/usr/share/syslinux/com32/include/serial.h': No such file or directory
+
+The cp is happened in the "libupload" dir, while "rm -fr" is happend in
+"lib" dir, let "libupload" depend "lib" will fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ com32/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/com32/Makefile b/com32/Makefile
+index 9a1721b..f172db2 100644
+--- a/com32/Makefile
++++ b/com32/Makefile
+@@ -21,3 +21,4 @@ rosh: lib libutil
+ samples: libutil elflink/ldlinux
+ sysdump: libupload gpllib
+ gpllib: lib
++libupload: lib
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch
new file mode 100644
index 000000000..7c003e165
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch
@@ -0,0 +1,17 @@
+This script try to call git submodule, since we are downloading
+the tarball it seems in-correct to do this.
+
+Upstream-Status: Inappropriate [OE-Specific]
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Index: syslinux-6.03/efi/Makefile
+===================================================================
+--- syslinux-6.03.orig/efi/Makefile
++++ syslinux-6.03/efi/Makefile
+@@ -101,7 +101,6 @@ tidy dist:
+ rm -f *.so *.o wrapper
+ find . \( -name \*.o -o -name \*.a -o -name .\*.d -o -name \*.tmp \) -print0 | \
+ xargs -0r rm -f
+- $(topdir)/efi/clean-gnu-efi.sh $(EFI_SUBARCH) $(objdir)
+
+ clean: tidy
+
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
new file mode 100644
index 000000000..ab8a51a23
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb
@@ -0,0 +1,89 @@
+SUMMARY = "Multi-purpose linux bootloader"
+HOMEPAGE = "http://syslinux.zytor.com/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://README;beginline=35;endline=41;md5=558f2c71cb1fb9ba511ccd4858e48e8a"
+
+# If you really want to run syslinux, you need mtools. We just want the
+# ldlinux.* stuff for now, so skip mtools-native
+DEPENDS = "nasm-native util-linux e2fsprogs"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/boot/syslinux/syslinux-${PV}.tar.xz \
+ file://syslinux-fix-parallel-building-issue.patch \
+ file://syslinux-libupload-depend-lib.patch \
+ file://syslinux-remove-clean-script.patch \
+ file://0001-linux-syslinux-support-ext2-3-4-device.patch \
+ file://0002-linux-syslinux-implement-open_ext2_fs.patch \
+ file://0003-linux-syslinux-implement-install_to_ext2.patch \
+ file://0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch \
+ file://0005-linux-syslinux-implement-handle_adv_on_ext.patch \
+ file://0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch \
+ file://0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch \
+ file://0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch \
+ file://0009-linux-syslinux-implement-install_bootblock.patch \
+ file://0010-gcc46-compatibility.patch \
+ file://0011-mk-MMD-does-not-take-any-arguments.patch \
+ "
+
+SRC_URI[md5sum] = "92a253df9211e9c20172796ecf388f13"
+SRC_URI[sha256sum] = "26d3986d2bea109d5dc0e4f8c4822a459276cf021125e8c9f23c3cca5d8c850e"
+
+COMPATIBLE_HOST = '(x86_64|i.86).*-(linux|freebsd.*)'
+# Don't let the sanity checker trip on the 32 bit real mode BIOS binaries
+INSANE_SKIP_${PN}-misc = "arch"
+INSANE_SKIP_${PN}-chain = "arch"
+
+EXTRA_OEMAKE = " \
+ BINDIR=${bindir} SBINDIR=${sbindir} LIBDIR=${libdir} \
+ DATADIR=${datadir} MANDIR=${mandir} INCDIR=${includedir} \
+"
+
+do_configure() {
+ # drop win32 targets or build fails
+ sed -e 's,win32/\S*,,g' -i Makefile
+
+ # clean installer executables included in source tarball
+ oe_runmake clean firmware="efi32" EFIINC="${includedir}"
+ # NOTE: There is a temporary work around above to specify
+ # the efi32 as the firmware else the pre-built bios
+ # files get erased contrary to the doc/distib.txt
+ # In the future this should be "bios" and not "efi32".
+}
+
+do_compile() {
+ # Make sure the recompile is OK.
+ # Though the ${B} should always exist, still check it before find and rm.
+ [ -d "${B}" ] && find ${B} -name '.*.d' -type f -exec rm -f {} \;
+
+ # Rebuild only the installer; keep precompiled bootloaders
+ # as per author's request (doc/distrib.txt)
+ oe_runmake CC="${CC} ${CFLAGS}" LD="${LD}" LDFLAGS="${LDFLAGS}" firmware="bios" installer
+}
+
+do_install() {
+ oe_runmake CC="${CC} ${CFLAGS}" LD="${LD}" install INSTALLROOT="${D}" firmware="bios"
+
+ install -d ${D}${datadir}/syslinux/
+ install -m 644 ${S}/bios/core/ldlinux.sys ${D}${datadir}/syslinux/
+ install -m 644 ${S}/bios/core/ldlinux.bss ${D}${datadir}/syslinux/
+ install -m 755 ${S}/bios/linux/syslinux-nomtools ${D}${bindir}/
+}
+
+PACKAGES += "${PN}-nomtools ${PN}-extlinux ${PN}-mbr ${PN}-chain ${PN}-pxelinux ${PN}-isolinux ${PN}-misc"
+
+RDEPENDS_${PN} += "mtools"
+RDEPENDS_${PN}-nomtools += "libext2fs"
+RDEPENDS_${PN}-misc += "perl"
+
+FILES_${PN} = "${bindir}/syslinux"
+FILES_${PN}-nomtools = "${bindir}/syslinux-nomtools"
+FILES_${PN}-extlinux = "${sbindir}/extlinux"
+FILES_${PN}-mbr = "${datadir}/${BPN}/mbr.bin"
+FILES_${PN}-chain = "${datadir}/${BPN}/chain.c32"
+FILES_${PN}-isolinux = "${datadir}/${BPN}/isolinux.bin"
+FILES_${PN}-pxelinux = "${datadir}/${BPN}/pxelinux.0"
+FILES_${PN}-dev += "${datadir}/${BPN}/com32/lib*${SOLIBS} ${datadir}/${BPN}/com32/include ${datadir}/${BPN}/com32/com32.ld"
+FILES_${PN}-staticdev += "${datadir}/${BPN}/com32/lib*.a ${libdir}/${BPN}/com32/lib*.a"
+FILES_${PN}-misc = "${datadir}/${BPN}/* ${libdir}/${BPN}/* ${bindir}/*"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/0001-canonicalize_file_name-is-specific-to-glibc.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/0001-canonicalize_file_name-is-specific-to-glibc.patch
new file mode 100644
index 000000000..5f93c46f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/0001-canonicalize_file_name-is-specific-to-glibc.patch
@@ -0,0 +1,46 @@
+From 23a3759b74d081b3b2849b0d37a0e5219f37813e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 22:37:48 +0000
+Subject: [PATCH] canonicalize_file_name is specific to glibc
+
+When on Linux and not using glibc then we need to define
+canonicalize_file_name() API, therefore add a check for finding out if
+its not glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ agent/tcf/framework/mdep.c | 2 +-
+ agent/tcf/framework/mdep.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/agent/tcf/framework/mdep.c b/agent/tcf/framework/mdep.c
+index 2b52ca8..7d09655 100644
+--- a/agent/tcf/framework/mdep.c
++++ b/agent/tcf/framework/mdep.c
+@@ -1042,7 +1042,7 @@ char * canonicalize_file_name(const char * path) {
+ return strdup(res);
+ }
+
+-#elif defined(__UCLIBC__)
++#elif defined(__UCLIBC__) || !defined(__GLIBC__)
+
+ char * canonicalize_file_name(const char * path) {
+ return realpath(path, NULL);
+diff --git a/agent/tcf/framework/mdep.h b/agent/tcf/framework/mdep.h
+index 1e718a2..187c399 100644
+--- a/agent/tcf/framework/mdep.h
++++ b/agent/tcf/framework/mdep.h
+@@ -276,7 +276,7 @@ extern int loc_clock_gettime(int, struct timespec *);
+
+ #define O_BINARY 0
+
+-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || !defined(__GLIBC__)
+ # define O_LARGEFILE 0
+ extern char ** environ;
+ extern char * canonicalize_file_name(const char * path);
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch
new file mode 100644
index 000000000..5d704567c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Inappropriate [poky-specific fix]
+
+--- a/Makefile.inc
++++ b/Makefile.inc
+@@ -57,6 +57,9 @@
+ ifeq ($(NO_UUID),)
+ LIBS += -luuid
+ endif
++ ifneq ($(RANLIB),)
++ RANLIB += $@
++ endif
+ endif
+
+ ifneq ($(OPSYS),Windows)
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/ldflags.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/ldflags.patch
new file mode 100644
index 000000000..c03c55d22
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/ldflags.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+From d92af0483c20365fd0af740d0baef8870b4aa374 Mon Sep 17 00:00:00 2001
+From: Abdur Rehman <abdur_rehman@mentor.com>
+Date: Wed, 26 Aug 2015 19:18:11 +0500
+Subject: [PATCH] tcf-agent: obey LDFLAGS
+
+Signed-off-by: Abdur Rehman <abdur_rehman@mentor.com>
+---
+ Makefile.inc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.inc b/Makefile.inc
+index 959028f..3148942 100644
+--- a/Makefile.inc
++++ b/Makefile.inc
+@@ -96,7 +96,7 @@ NO_LINK_F ?= -c
+ # Linker definition and flags
+
+ LINK ?= $(CC)
+-LINK_FLAGS ?= $(CFLAGS)
++LINK_FLAGS ?= $(LDFLAGS) $(CFLAGS)
+ LINK_OUT_F ?= $(OUT_OBJ_F)
+
+ # Archiver definition and flags
+--
+1.7.9.5
+
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
new file mode 100755
index 000000000..6303280aa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
@@ -0,0 +1,75 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: tcf-agent
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: Target Communication Framework agent
+### END INIT INFO
+
+DAEMON_PATH=/usr/sbin/tcf-agent
+DAEMON_NAME=`basename $DAEMON_PATH`
+
+. /etc/init.d/functions
+
+test -x $DAEMON_PATH || exit 0
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+export PATH
+
+RETVAL=0
+
+case "$1" in
+ start)
+ echo -n "Starting $DAEMON_NAME: "
+ $DAEMON_PATH -d -L- -l0
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ] ; then
+ echo "OK"
+ touch /var/lock/subsys/$DAEMON_NAME
+ else
+ echo "FAIL"
+ fi
+ ;;
+
+ 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
+ rm -f /var/lock/subsys/$DAEMON_NAME
+ if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then
+ echo "FAIL"
+ else
+ echo "OK"
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ status)
+ status $DAEMON_NAME
+ RETVAL=$?
+ ;;
+
+ condrestart)
+ [ -f /var/lock/subsys/$DAEMON_NAME ] && $0 restart
+ ;;
+
+ *)
+ echo "usage: $0 { start | stop | status | restart | condrestart | status }"
+ ;;
+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
new file mode 100644
index 000000000..fd9a6c4d5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Target Communication Framework agent
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/tcf-agent -d -L- -l0
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
new file mode 100644
index 000000000..ab2fcd7ab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Target Communication Framework for the Eclipse IDE"
+HOMEPAGE = "http://wiki.eclipse.org/TCF"
+BUGTRACKER = "https://bugs.eclipse.org/bugs/"
+
+LICENSE = "EPL-1.0 | EDL-1.0"
+LIC_FILES_CHKSUM = "file://edl-v10.html;md5=522a390a83dc186513f0500543ad3679"
+
+SRCREV = "b9a735e9c7cf82f80d412b7ab15d08b89d5a4ccc"
+PV = "1.3.0+git${SRCPV}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+SRC_URI = "git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git;branch=1.3_mars_bugfix \
+ file://fix_ranlib.patch \
+ file://ldflags.patch \
+ file://0001-canonicalize_file_name-is-specific-to-glibc.patch;striplevel=2 \
+ file://tcf-agent.init \
+ file://tcf-agent.service \
+ "
+
+DEPENDS = "util-linux openssl"
+RDEPENDS_${PN} = "bash"
+
+S = "${WORKDIR}/git/agent"
+
+inherit update-rc.d systemd
+
+SYSTEMD_SERVICE_${PN} = "tcf-agent.service"
+
+INITSCRIPT_NAME = "tcf-agent"
+INITSCRIPT_PARAMS = "start 99 3 5 . stop 20 0 1 2 6 ."
+
+# mangling needed for make
+MAKE_ARCH = "`echo ${TARGET_ARCH} | sed s,i.86,i686,`"
+MAKE_OS = "`echo ${TARGET_OS} | sed s,^linux.*,GNU/Linux,`"
+
+EXTRA_OEMAKE = "MACHINE=${MAKE_ARCH} OPSYS=${MAKE_OS} 'CC=${CC}' 'AR=${AR}'"
+
+# They don't build on ARM and we don't need them actually.
+CFLAGS += "-DSERVICE_RunControl=0 -DSERVICE_Breakpoints=0 \
+ -DSERVICE_Memory=0 -DSERVICE_Registers=0 -DSERVICE_MemoryMap=0 \
+ -DSERVICE_StackTrace=0 -DSERVICE_Symbols=0 -DSERVICE_LineNumbers=0 \
+ -DSERVICE_Expressions=0"
+
+do_install() {
+ oe_runmake install INSTALLROOT=${D}
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/tcf-agent.init ${D}${sysconfdir}/init.d/tcf-agent
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/tcf-agent.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/tcf-agent.service
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch
new file mode 100644
index 000000000..c8530e1f5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch
@@ -0,0 +1,76 @@
+Lets install the include header and private header files into
+usr/include/tcl8.6 when version of tcl is 8.6.x
+
+Upstream-Status: Inappropriate [Configuration Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmai.com>
+
+Fixed the TCL_INCLUDE_SPEC
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.in | 2 +-
+ configure | 4 ++--
+ configure.in | 4 ++--
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 97b983b..dc2a4df 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -53,7 +53,7 @@ DLL_INSTALL_DIR = @DLL_INSTALL_DIR@
+ SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TCL_LIBRARY)
+
+ # Directory in which to install the include file tcl.h:
+-INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir)
++INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir)/tcl$(VERSION)
+
+ # Path to the private tcl header dir:
+ PRIVATE_INCLUDE_DIR = @PRIVATE_INCLUDE_DIR@
+diff --git a/configure b/configure
+index 3e78b49..24b3f92 100755
+--- a/configure
++++ b/configure
+@@ -19134,7 +19134,7 @@ eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}"
+ eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
+
+ TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
+-PRIVATE_INCLUDE_DIR='$(includedir)'
++PRIVATE_INCLUDE_DIR='$(includedir)/tcl$(VERSION)'
+ HTML_DIR='$(DISTDIR)/html'
+
+ # Note: in the following variable, it's important to use the absolute
+@@ -19293,7 +19293,7 @@ TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}"
+ TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}"
+
+ # Install time header dir can be set via --includedir
+-eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
++eval "TCL_INCLUDE_SPEC=\"-I${includedir}/tcl${VERSION}\""
+
+ #------------------------------------------------------------------------
+ # tclConfig.sh refers to this by a different name
+diff --git a/configure.in b/configure.in
+index 0e28b14..62d9b41 100755
+--- a/configure.in
++++ b/configure.in
+@@ -791,7 +791,7 @@ eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}"
+ eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
+
+ TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
+-PRIVATE_INCLUDE_DIR='$(includedir)'
++PRIVATE_INCLUDE_DIR='$(includedir)/tcl$(VERSION)'
+ HTML_DIR='$(DISTDIR)/html'
+
+ # Note: in the following variable, it's important to use the absolute
+@@ -912,7 +912,7 @@ TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}"
+ TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}"
+
+ # Install time header dir can be set via --includedir
+-eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
++eval "TCL_INCLUDE_SPEC=\"-I${includedir}/tcl${VERSION}\""
+
+ #------------------------------------------------------------------------
+ # tclConfig.sh refers to this by a different name
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch
new file mode 100644
index 000000000..5b5de0730
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Fixes tcl target recipe build on old distros which have glibc older than 2.14
+
+| + echo 'NOTE: make DESTDIR=/srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image install'
+| NOTE: make DESTDIR=/srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image install
+| + make DESTDIR=/srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image install
+| Making directory /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image/usr/lib
+| Installing message catalogs
+| Making directory /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image/usr/share/man
+| tclsh: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/tcl8.5.11/unix/libtcl8.5.so)
+| Making directory /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image/usr/bin
+| make: *** [install-msgs] Error 1
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/04/26
+
+Index: unix/Makefile.in
+===================================================================
+--- unix.orig/Makefile.in 2013-11-10 23:38:01.787425628 -0800
++++ unix/Makefile.in 2013-11-10 23:37:59.807425578 -0800
+@@ -686,7 +686,7 @@
+ # tcltest executable gets the build directory burned into its ld search path.
+ # This keeps tcltest from picking up an already installed version of the Tcl
+ # library.
+-SHELL_ENV = @LD_LIBRARY_PATH_VAR@=`pwd`:${@LD_LIBRARY_PATH_VAR@} \
++SHELL_ENV = @LD_LIBRARY_PATH_VAR@=${@LD_LIBRARY_PATH_VAR@} \
+ TCLLIBPATH="@abs_builddir@/pkgs" \
+ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"
+
+@@ -712,7 +712,7 @@
+ $(SHELL_ENV) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
+
+ gdb-test: ${TCLTEST_EXE}
+- @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run
++ @echo "set env @LD_LIBRARY_PATH_VAR@=$${@LD_LIBRARY_PATH_VAR@}" > gdb.run
+ @echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run
+ @echo "set args $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) -singleproc 1" >> gdb.run
+ $(GDB) ${TCLTEST_EXE} --command=gdb.run
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch
new file mode 100644
index 000000000..c60eb7537
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch
@@ -0,0 +1,64 @@
+Upstream-Status: Pending
+
+Index: unix/Makefile.in
+===================================================================
+--- unix.orig/Makefile.in 2013-11-10 23:37:34.243424934 -0800
++++ unix/Makefile.in 2013-11-10 23:37:34.243424934 -0800
+@@ -709,23 +709,23 @@
+ test: test-tcl test-packages
+
+ test-tcl: ${TCLTEST_EXE}
+- $(SHELL_ENV) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
++ $(SHELL_ENV) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
+
+ gdb-test: ${TCLTEST_EXE}
+ @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run
+ @echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run
+ @echo "set args $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) -singleproc 1" >> gdb.run
+- $(GDB) ./${TCLTEST_EXE} --command=gdb.run
++ $(GDB) ${TCLTEST_EXE} --command=gdb.run
+ rm gdb.run
+
+ # Useful target to launch a built tcltest with the proper path,...
+ runtest: ${TCLTEST_EXE}
+- $(SHELL_ENV) ./${TCLTEST_EXE}
++ $(SHELL_ENV) ${TCLTEST_EXE}
+
+ # Useful target for running the test suite with an unwritable current
+ # directory...
+ ro-test: ${TCLTEST_EXE}
+- echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ./${TCLTEST_EXE}
++ echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ${TCLTEST_EXE}
+
+ # The following target generates the shared libraries in dltest/ that are used
+ # for testing; they are included as part of the "tcltest" target (via the
+@@ -743,23 +743,23 @@
+ # This target can be used to run tclsh from the build directory
+ # via `make shell SCRIPT=/tmp/foo.tcl`
+ shell: ${TCL_EXE}
+- $(SHELL_ENV) ./${TCL_EXE} $(SCRIPT)
++ $(SHELL_ENV) ${TCL_EXE} $(SCRIPT)
+
+ # This target can be used to run tclsh inside either gdb or insight
+ gdb: ${TCL_EXE}
+- $(SHELL_ENV) $(GDB) ./${TCL_EXE}
++ $(SHELL_ENV) $(GDB) ${TCL_EXE}
+
+ valgrind: ${TCL_EXE} ${TCLTEST_EXE}
+- $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 -constraints valgrind $(TESTFLAGS)
++ $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 -constraints valgrind $(TESTFLAGS)
+
+ valgrindshell: ${TCL_EXE}
+- $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCL_EXE} $(SCRIPT)
++ $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ${TCL_EXE} $(SCRIPT)
+
+ trace-shell: ${TCL_EXE}
+- $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCL_EXE} $(SCRIPT)
++ $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ${TCL_EXE} $(SCRIPT)
+
+ trace-test: ${TCLTEST_EXE}
+- $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS)
++ $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS)
+
+ #--------------------------------------------------------------------------
+ # Installation rules
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/no_packages.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/no_packages.patch
new file mode 100644
index 000000000..ab6cc4316
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/no_packages.patch
@@ -0,0 +1,53 @@
+tcl 8.6.0 builds by default a number of packages that are not needed in Yocto.
+This patch changes the makefile so that these packages are not built by default.
+
+Upstream-Status:Inappropriate [embedded specific]
+
+Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
+
+Index: unix/Makefile.in
+===================================================================
+--- unix.orig/Makefile.in 2013-11-10 23:38:12.235425891 -0800
++++ unix/Makefile.in 2013-11-10 23:38:12.231425891 -0800
+@@ -611,7 +611,7 @@
+ # Start of rules
+ #--------------------------------------------------------------------------
+
+-all: binaries libraries doc packages
++all: binaries libraries doc
+
+ binaries: ${LIB_FILE} $(STUB_LIB_FILE) ${TCL_EXE}
+
+@@ -653,12 +653,12 @@
+ #tclConfig.h: $(UNIX_DIR)/tclConfig.h.in
+ # $(SHELL) config.status
+
+-clean: clean-packages
++clean:
+ rm -f *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \
+ errors ${TCL_EXE} ${TCLTEST_EXE} lib.exp Tcl @DTRACE_HDR@
+ cd dltest ; $(MAKE) clean
+
+-distclean: distclean-packages clean
++distclean: clean
+ rm -rf Makefile config.status config.cache config.log tclConfig.sh \
+ tclConfig.h *.plist Tcl.framework tcl.pc
+ cd dltest ; $(MAKE) distclean
+@@ -706,7 +706,7 @@
+ # tcltest, ie:
+ # % make test TESTFLAGS="-verbose bps -file fileName.test"
+
+-test: test-tcl test-packages
++test: test-tcl
+
+ test-tcl: ${TCLTEST_EXE}
+ $(SHELL_ENV) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
+@@ -771,7 +771,7 @@
+ INSTALL_DEV_TARGETS = install-headers
+ INSTALL_EXTRA_TARGETS = @EXTRA_INSTALL@
+ INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DOC_TARGETS) $(INSTALL_DEV_TARGETS) \
+- $(INSTALL_PACKAGE_TARGETS) $(INSTALL_EXTRA_TARGETS)
++ $(INSTALL_EXTRA_TARGETS)
+
+ install: $(INSTALL_TARGETS)
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/run-ptest
new file mode 100644
index 000000000..dadba655f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/run-ptest
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+for i in `ls tests/*.test |awk -F/ '{print $2}'`; \
+ do TCL_LIBRARY=library ./tcltest tests/all.tcl -file $i >$i.tmp 2>&1; \
+ grep -q "^Files with failing tests:" $i.tmp; \
+ if [ $? -eq 0 ]; then echo "FAIL: $i"; \
+ else echo "PASS: $i"; rm -f $i.tmp; fi; \
+done
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch
new file mode 100644
index 000000000..96276eab0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Pending
+
+Index: unix/configure
+===================================================================
+--- unix.orig/configure 2013-09-19 13:17:13.000000000 -0700
++++ unix/configure 2013-11-11 00:20:51.519490342 -0800
+@@ -7599,6 +7599,9 @@
+ # get rid of the warnings.
+ #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
+
++ # following line added by CW for Debian GNU/Linux
++ TCL_SHLIB_LD_EXTRAS="-Wl,-soname,\${TCL_LIB_FILE}.0"
++
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+Index: unix/tcl.m4
+===================================================================
+--- unix.orig/tcl.m4 2013-09-19 13:17:13.000000000 -0700
++++ unix/tcl.m4 2013-11-11 00:17:24.263485123 -0800
+@@ -1415,6 +1415,9 @@
+ # get rid of the warnings.
+ #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
+
++ # following line added by CW for Debian GNU/Linux
++ TCL_SHLIB_LD_EXTRAS="-Wl,-soname,\${TCL_LIB_FILE}.0"
++
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+Index: unix/Makefile.in
+===================================================================
+--- unix.orig/Makefile.in 2013-09-19 13:17:13.000000000 -0700
++++ unix/Makefile.in 2013-11-11 00:20:32.423489861 -0800
+@@ -796,7 +796,10 @@
+ done;
+ @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/"
+ @@INSTALL_LIB@
+- @chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)"
++ mv "$(DLL_INSTALL_DIR)"/$(LIB_FILE) "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0
++ ln -sf $(LIB_FILE).0 "$(DLL_INSTALL_DIR)"/$(LIB_FILE)
++ ln -sf "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0 ./
++ @chmod 555 "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0
+ @echo "Installing ${TCL_EXE} as $(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
+ @$(INSTALL_PROGRAM) ${TCL_EXE} "$(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
+ @echo "Installing tclConfig.sh to $(CONFIG_INSTALL_DIR)/"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch
new file mode 100644
index 000000000..16f7c8051
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch
@@ -0,0 +1,47 @@
+From 6efc98774681795712073c2b91e5e9d1763239b8 Mon Sep 17 00:00:00 2001
+From: "Song.Li" <Song.Li@windriver.com>
+Date: Wed, 1 Aug 2012 19:05:51 +0800
+Subject: [PATCH] tcl:install tcl to lib64 instead of lib on 64bit target
+
+Remove hardcoded library install path. Change $(prefix)/lib/ to ${libdir}.
+
+[YOCTO #2876]
+
+This is not a bug, but libraries should be installed into directory .../lib/.
+On 64bit target that should be lib64/.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Song.Li <Song.Li@windriver.com>
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: unix/configure
+===================================================================
+--- unix.orig/configure 2013-11-10 23:38:33.643426430 -0800
++++ unix/configure 2013-11-10 23:39:51.347428387 -0800
+@@ -19134,7 +19134,7 @@
+
+ eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
+
+-TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
++TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
+ PRIVATE_INCLUDE_DIR='$(includedir)'
+ HTML_DIR='$(DISTDIR)/html'
+
+Index: unix/configure.in
+===================================================================
+--- unix.orig/configure.in 2013-11-10 23:20:50.000000000 -0800
++++ unix/configure.in 2013-11-10 23:39:41.199428131 -0800
+@@ -790,7 +790,7 @@
+
+ eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
+
+-TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
++TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
+ PRIVATE_INCLUDE_DIR='$(includedir)'
+ HTML_DIR='$(DISTDIR)/html'
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl_8.6.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl_8.6.4.bb
new file mode 100644
index 000000000..8e92b3e24
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/tcltk/tcl_8.6.4.bb
@@ -0,0 +1,102 @@
+SUMMARY = "Tool Command Language"
+HOMEPAGE = "http://tcl.sourceforge.net"
+SECTION = "devel/tcltk"
+
+# http://www.tcl.tk/software/tcltk/license.html
+LICENSE = "tcl & BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://../license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+ file://../compat/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+ file://../library/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+ file://../macosx/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+ file://../tests/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+ file://../win/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+"
+
+DEPENDS = "tcl-native zlib"
+
+BASE_SRC_URI = "${SOURCEFORGE_MIRROR}/tcl/${BPN}${PV}-src.tar.gz \
+ file://tcl-add-soname.patch"
+SRC_URI = "${BASE_SRC_URI} \
+ file://fix_non_native_build_issue.patch \
+ file://fix_issue_with_old_distro_glibc.patch \
+ file://no_packages.patch \
+ file://tcl-remove-hardcoded-install-path.patch \
+ file://alter-includedir.patch \
+ file://run-ptest \
+"
+SRC_URI[md5sum] = "d7cbb91f1ded1919370a30edd1534304"
+SRC_URI[sha256sum] = "9e6ed94c981c1d0c5f5fefb8112d06c6bf4d050a7327e95e71d417c416519c8d"
+
+SRC_URI_class-native = "${BASE_SRC_URI}"
+
+S = "${WORKDIR}/${BPN}${PV}/unix"
+
+VER = "${PV}"
+
+inherit autotools ptest binconfig
+
+DEPENDS_class-native = "zlib-native"
+
+EXTRA_OECONF = "--enable-threads --disable-rpath --libdir=${libdir}"
+
+do_configure() {
+ cd ${S}
+ gnu-configize
+ cd ${B}
+ oe_runconf
+}
+
+do_compile_prepend() {
+ echo > ${S}/../compat/fixstrtod.c
+}
+
+do_install() {
+ 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${libdir},-L=${libdir},g" tclConfig.sh
+ sed -i "s,-I${includedir},-I=${includedir},g" tclConfig.sh
+ install -d ${D}${bindir_crossscripts}
+ install -m 0755 tclConfig.sh ${D}${bindir_crossscripts}
+ install -m 0755 tclConfig.sh ${D}${libdir}
+ cd ..
+ for dir in compat generic unix; do
+ install -d ${D}${includedir}/${BPN}${VER}/$dir
+ install -m 0644 ${S}/../$dir/*.h ${D}${includedir}/${BPN}${VER}/$dir/
+ done
+}
+
+SYSROOT_PREPROCESS_FUNCS += "tcl_sysroot_preprocess"
+tcl_sysroot_preprocess () {
+ sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
+}
+
+PACKAGES =+ "tcl-lib"
+FILES_tcl-lib = "${libdir}/libtcl8.6.so.*"
+FILES_${PN} += "${libdir}/tcl${VER} ${libdir}/tcl8.6 ${libdir}/tcl8"
+FILES_${PN}-dev += "${libdir}/tclConfig.sh ${libdir}/tclooConfig.sh"
+
+# isn't getting picked up by shlibs code
+RDEPENDS_${PN} += "tcl-lib"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}-ptest += "libgcc"
+
+BBCLASSEXTEND = "native"
+
+do_compile_ptest() {
+ oe_runmake tcltest
+}
+
+do_install_ptest() {
+ cp ${B}/tcltest ${D}${PTEST_PATH}
+ cp -r ${S}/../library ${D}${PTEST_PATH}
+ cp -r ${S}/../tests ${D}${PTEST_PATH}
+}
+
+# Fix some paths that might be used by Tcl extensions
+BINCONFIG_GLOB = "*Config.sh"
+
+# Fix the path in sstate
+SSTATE_SCAN_FILES += "*Config.sh"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch
new file mode 100644
index 000000000..ff745d477
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch
@@ -0,0 +1,158 @@
+Add ability to specify rcp port numbers
+
+In order to run more than one unfs server on a host system, you must
+be able to specify alternate rpc port numbers.
+
+Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ daemon.c | 44 +++++++++++++++++++++++++++++++-------------
+ mount.c | 4 ++--
+ 2 files changed, 33 insertions(+), 15 deletions(-)
+
+--- a/daemon.c
++++ b/daemon.c
+@@ -78,6 +78,8 @@ int opt_testconfig = FALSE;
+ struct in_addr opt_bind_addr;
+ int opt_readable_executables = FALSE;
+ char *opt_pid_file = NULL;
++int nfs_prog = NFS3_PROGRAM;
++int mount_prog = MOUNTPROG;
+
+ /* Register with portmapper? */
+ int opt_portmapper = TRUE;
+@@ -206,7 +208,7 @@ static void parse_options(int argc, char
+ {
+
+ int opt = 0;
+- char *optstring = "bcC:de:hl:m:n:prstTuwi:";
++ char *optstring = "bcC:de:hl:m:n:prstTuwi:x:y:";
+
+ while (opt != -1) {
+ opt = getopt(argc, argv, optstring);
+@@ -261,8 +263,24 @@ static void parse_options(int argc, char
+ printf
+ ("\t-r report unreadable executables as readable\n");
+ printf("\t-T test exports file and exit\n");
++ printf("\t-x <port> alternate NFS RPC port\n");
++ printf("\t-y <port> alternate MOUNTD RPC port\n");
+ exit(0);
+ break;
++ case 'x':
++ nfs_prog = strtol(optarg, NULL, 10);
++ if (nfs_prog == 0) {
++ fprintf(stderr, "Invalid NFS RPC port\n");
++ exit(1);
++ }
++ break;
++ case 'y':
++ mount_prog = strtol(optarg, NULL, 10);
++ if (mount_prog == 0) {
++ fprintf(stderr, "Invalid MOUNTD RPC port\n");
++ exit(1);
++ }
++ break;
+ case 'l':
+ opt_bind_addr.s_addr = inet_addr(optarg);
+ if (opt_bind_addr.s_addr == (unsigned) -1) {
+@@ -347,12 +365,12 @@ void daemon_exit(int error)
+ #endif /* WIN32 */
+
+ if (opt_portmapper) {
+- svc_unregister(MOUNTPROG, MOUNTVERS1);
+- svc_unregister(MOUNTPROG, MOUNTVERS3);
++ svc_unregister(mount_prog, MOUNTVERS1);
++ svc_unregister(mount_prog, MOUNTVERS3);
+ }
+
+ if (opt_portmapper) {
+- svc_unregister(NFS3_PROGRAM, NFS_V3);
++ svc_unregister(nfs_prog, NFS_V3);
+ }
+
+ if (error == SIGSEGV)
+@@ -657,13 +675,13 @@ static void mountprog_3(struct svc_req *
+ static void register_nfs_service(SVCXPRT * udptransp, SVCXPRT * tcptransp)
+ {
+ if (opt_portmapper) {
+- pmap_unset(NFS3_PROGRAM, NFS_V3);
++ pmap_unset(nfs_prog, NFS_V3);
+ }
+
+ if (udptransp != NULL) {
+ /* Register NFS service for UDP */
+ if (!svc_register
+- (udptransp, NFS3_PROGRAM, NFS_V3, nfs3_program_3,
++ (udptransp, nfs_prog, NFS_V3, nfs3_program_3,
+ opt_portmapper ? IPPROTO_UDP : 0)) {
+ fprintf(stderr, "%s\n",
+ "unable to register (NFS3_PROGRAM, NFS_V3, udp).");
+@@ -674,7 +692,7 @@ static void register_nfs_service(SVCXPRT
+ if (tcptransp != NULL) {
+ /* Register NFS service for TCP */
+ if (!svc_register
+- (tcptransp, NFS3_PROGRAM, NFS_V3, nfs3_program_3,
++ (tcptransp, nfs_prog, NFS_V3, nfs3_program_3,
+ opt_portmapper ? IPPROTO_TCP : 0)) {
+ fprintf(stderr, "%s\n",
+ "unable to register (NFS3_PROGRAM, NFS_V3, tcp).");
+@@ -686,14 +704,14 @@ static void register_nfs_service(SVCXPRT
+ static void register_mount_service(SVCXPRT * udptransp, SVCXPRT * tcptransp)
+ {
+ if (opt_portmapper) {
+- pmap_unset(MOUNTPROG, MOUNTVERS1);
+- pmap_unset(MOUNTPROG, MOUNTVERS3);
++ pmap_unset(mount_prog, MOUNTVERS1);
++ pmap_unset(mount_prog, MOUNTVERS3);
+ }
+
+ if (udptransp != NULL) {
+ /* Register MOUNT service (v1) for UDP */
+ if (!svc_register
+- (udptransp, MOUNTPROG, MOUNTVERS1, mountprog_3,
++ (udptransp, mount_prog, MOUNTVERS1, mountprog_3,
+ opt_portmapper ? IPPROTO_UDP : 0)) {
+ fprintf(stderr, "%s\n",
+ "unable to register (MOUNTPROG, MOUNTVERS1, udp).");
+@@ -702,7 +720,7 @@ static void register_mount_service(SVCXP
+
+ /* Register MOUNT service (v3) for UDP */
+ if (!svc_register
+- (udptransp, MOUNTPROG, MOUNTVERS3, mountprog_3,
++ (udptransp, mount_prog, MOUNTVERS3, mountprog_3,
+ opt_portmapper ? IPPROTO_UDP : 0)) {
+ fprintf(stderr, "%s\n",
+ "unable to register (MOUNTPROG, MOUNTVERS3, udp).");
+@@ -713,7 +731,7 @@ static void register_mount_service(SVCXP
+ if (tcptransp != NULL) {
+ /* Register MOUNT service (v1) for TCP */
+ if (!svc_register
+- (tcptransp, MOUNTPROG, MOUNTVERS1, mountprog_3,
++ (tcptransp, mount_prog, MOUNTVERS1, mountprog_3,
+ opt_portmapper ? IPPROTO_TCP : 0)) {
+ fprintf(stderr, "%s\n",
+ "unable to register (MOUNTPROG, MOUNTVERS1, tcp).");
+@@ -722,7 +740,7 @@ static void register_mount_service(SVCXP
+
+ /* Register MOUNT service (v3) for TCP */
+ if (!svc_register
+- (tcptransp, MOUNTPROG, MOUNTVERS3, mountprog_3,
++ (tcptransp, mount_prog, MOUNTVERS3, mountprog_3,
+ opt_portmapper ? IPPROTO_TCP : 0)) {
+ fprintf(stderr, "%s\n",
+ "unable to register (MOUNTPROG, MOUNTVERS3, tcp).");
+--- a/mount.c
++++ b/mount.c
+@@ -155,8 +155,8 @@ mountres3 *mountproc_mnt_3_svc(dirpath *
+ /* error out if not version 3 */
+ if (rqstp->rq_vers != 3) {
+ logmsg(LOG_INFO,
+- "%s attempted mount with unsupported protocol version",
+- inet_ntoa(get_remote(rqstp)));
++ "%s attempted mount with unsupported protocol version: %i",
++ inet_ntoa(get_remote(rqstp)), rqstp->rq_vers);
+ result.fhs_status = MNT3ERR_INVAL;
+ return &result;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch
new file mode 100644
index 000000000..aada01411
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch
@@ -0,0 +1,25 @@
+daemon.c: Check exit code of chdir()
+
+Stop the compile warning and fix the code to act on a chdir() failure.
+If this one does fail something is very, very wrong.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ daemon.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/daemon.c
++++ b/daemon.c
+@@ -964,7 +964,8 @@ int main(int argc, char **argv)
+ sigaction(SIGALRM, &act, NULL);
+
+ /* don't make directory we started in busy */
+- chdir("/");
++ if(chdir("/") < 0)
++ daemon_exit(0);
+
+ /* detach from terminal */
+ if (opt_detach) {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch
new file mode 100644
index 000000000..46b187e5f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch
@@ -0,0 +1,61 @@
+daemon.c: Fix race window for writing of the pid file
+
+The parent process should write the pid file such that the pid file
+will can be checked immediately following exit of the fork from the
+parent.
+
+This allows external monitoring applications to watch the daemon
+without having to add sleep calls to wait for the pid file be written
+on a busy system.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ daemon.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+--- a/daemon.c
++++ b/daemon.c
+@@ -153,7 +153,7 @@ int get_socket_type(struct svc_req *rqst
+ /*
+ * write current pid to a file
+ */
+-static void create_pid_file(void)
++static void create_pid_file(int pid)
+ {
+ char buf[16];
+ int fd, res, len;
+@@ -175,7 +175,7 @@ static void create_pid_file(void)
+ }
+ #endif
+
+- sprintf(buf, "%i\n", backend_getpid());
++ sprintf(buf, "%i\n", pid);
+ len = strlen(buf);
+
+ res = backend_pwrite(fd, buf, len, 0);
+@@ -970,6 +970,10 @@ int main(int argc, char **argv)
+ fprintf(stderr, "could not fork into background\n");
+ daemon_exit(0);
+ }
++ if (pid)
++ create_pid_file(pid);
++ } else {
++ create_pid_file(backend_getpid());
+ }
+ #endif /* WIN32 */
+
+@@ -1006,8 +1010,10 @@ int main(int argc, char **argv)
+ /* no umask to not screw up create modes */
+ umask(0);
+
++#ifdef WIN32
+ /* create pid file if wanted */
+- create_pid_file();
++ create_pid_file(backend_getpid());
++#endif
+
+ /* initialize internal stuff */
+ fh_cache_init();
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch
new file mode 100644
index 000000000..219dd35ae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch
@@ -0,0 +1,74 @@
+nfs.c: Allow max sa.sun_path for a localdomain socket with the user nfs-server
+
+There is a hard limit for the kernel of 108 characters for a
+localdomain socket name. To avoid problems with the user nfs
+server it should maximize the number of characters by using
+a relative path on the server side.
+
+Previously the nfs-server used the absolute path name passed to
+the sa.sunpath arg for binding the socket and this has caused
+problems for both the X server and UST binaries which make
+heavy use of named sockets with long names.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ nfs.c | 29 +++++++++++++++++++++++++++--
+ 1 file changed, 27 insertions(+), 2 deletions(-)
+
+--- a/nfs.c
++++ b/nfs.c
+@@ -672,6 +672,7 @@ SYMLINK3res *nfsproc3_symlink_3_svc(SYML
+ }
+
+ #ifndef WIN32
++static char pathbuf_tmp[NFS_MAXPATHLEN + NFS_MAXNAMLEN + 1];
+
+ /*
+ * create Unix socket
+@@ -680,17 +681,41 @@ static int mksocket(const char *path, mo
+ {
+ int res, sock;
+ struct sockaddr_un addr;
++ unsigned int len = strlen(path);
+
+ sock = socket(PF_UNIX, SOCK_STREAM, 0);
+- addr.sun_family = AF_UNIX;
+- strcpy(addr.sun_path, path);
+ res = sock;
+ if (res != -1) {
++ addr.sun_family = AF_UNIX;
++ if (len < sizeof(addr.sun_path) -1) {
++ strcpy(addr.sun_path, path);
++ } else {
++ char *ptr;
++ res = -1;
++ if (len >= sizeof(path))
++ goto out;
++ strcpy(pathbuf_tmp, path);
++ ptr = strrchr(pathbuf_tmp,'/');
++ if (ptr) {
++ *ptr = '\0';
++ ptr++;
++ if (chdir(pathbuf_tmp))
++ goto out;
++ } else {
++ ptr = pathbuf_tmp;
++ }
++ if (strlen(ptr) >= sizeof(addr.sun_path))
++ goto out;
++ strcpy(addr.sun_path, ptr);
++ }
+ umask(~mode);
+ res =
+ bind(sock, (struct sockaddr *) &addr,
+ sizeof(addr.sun_family) + strlen(addr.sun_path));
+ umask(0);
++out:
++ if (chdir("/"))
++ fprintf(stderr, "Internal failure to chdir /\n");
+ close(sock);
+ }
+ return res;
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch
new file mode 100644
index 000000000..e6d89530f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch
@@ -0,0 +1,64 @@
+From: Jason Wessel <jason.wessel@windriver.com>
+Date: Sat, 23 Feb 2013 08:49:08 -0600
+Subject: [PATCH] fh_cache: fix statle nfs handle on rename problem
+
+The following test case fails with modern linunx kernels which cache
+the renamed inode.
+
+ % mkdir a;mkdir b;mv b a/;ls -l a
+ ls: a/b: Stale NFS file handle
+
+The issue is that nfserver was not updating the fh_cache with the new
+location of the inode, when it moves directories.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ fh_cache.c | 12 ++++++++++++
+ fh_cache.h | 1 +
+ nfs.c | 2 ++
+ 3 files changed, 15 insertions(+)
+
+--- a/fh_cache.c
++++ b/fh_cache.c
+@@ -199,6 +199,18 @@ static char *fh_cache_lookup(uint32 dev,
+ }
+
+ /*
++ * update a fh inode cache for an operation like rename
++ */
++void fh_cache_update(nfs_fh3 fh, char *path)
++{
++ unfs3_fh_t *obj = (void *) fh.data.data_val;
++ backend_statstruct buf;
++
++ if (backend_lstat(path, &buf) != -1) {
++ fh_cache_add(obj->dev, buf.st_ino, path);
++ }
++}
++/*
+ * resolve a filename into a path
+ * cache-using wrapper for fh_decomp_raw
+ */
+--- a/fh_cache.h
++++ b/fh_cache.h
+@@ -19,5 +19,6 @@ unfs3_fh_t fh_comp(const char *path, str
+ unfs3_fh_t *fh_comp_ptr(const char *path, struct svc_req *rqstp, int need_dir);
+
+ char *fh_cache_add(uint32 dev, uint64 ino, const char *path);
++void fh_cache_update(nfs_fh3 fh, char *path);
+
+ #endif
+--- a/nfs.c
++++ b/nfs.c
+@@ -876,6 +876,8 @@ RENAME3res *nfsproc3_rename_3_svc(RENAME
+ res = backend_rename(from_obj, to_obj);
+ if (res == -1)
+ result.status = rename_err();
++ /* Update the fh_cache with moved inode value */
++ fh_cache_update(argp->to.dir, to_obj);
+ }
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch
new file mode 100644
index 000000000..b3521c63e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch
@@ -0,0 +1,56 @@
+daemon.c: Add option for tcp no delay
+
+Allow the NFS tcp sockets to conditionally use TCP_NODELAY
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ daemon.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/daemon.c
++++ b/daemon.c
+@@ -17,6 +17,7 @@
+ #ifndef WIN32
+ #include <sys/socket.h>
+ #include <netinet/in.h>
++#include <netinet/tcp.h>
+ #include <arpa/inet.h>
+ #include <syslog.h>
+ #else /* WIN32 */
+@@ -75,6 +76,7 @@ unsigned int opt_mount_port = NFS_PORT;
+ int opt_singleuser = FALSE;
+ int opt_brute_force = FALSE;
+ int opt_testconfig = FALSE;
++int opt_tcp_nodelay = FALSE;
+ struct in_addr opt_bind_addr;
+ int opt_readable_executables = FALSE;
+ char *opt_pid_file = NULL;
+@@ -208,7 +210,7 @@ static void parse_options(int argc, char
+ {
+
+ int opt = 0;
+- char *optstring = "bcC:de:hl:m:n:prstTuwi:x:y:";
++ char *optstring = "bcC:de:hl:m:Nn:prstTuwi:x:y:";
+
+ while (opt != -1) {
+ opt = getopt(argc, argv, optstring);
+@@ -295,6 +297,9 @@ static void parse_options(int argc, char
+ exit(1);
+ }
+ break;
++ case 'N':
++ opt_tcp_nodelay = TRUE;
++ break;
+ case 'n':
+ opt_nfs_port = strtol(optarg, NULL, 10);
+ if (opt_nfs_port == 0) {
+@@ -802,6 +807,8 @@ static SVCXPRT *create_tcp_transport(uns
+ sin.sin_addr.s_addr = opt_bind_addr.s_addr;
+ sock = socket(PF_INET, SOCK_STREAM, 0);
+ setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(on));
++ if (opt_tcp_nodelay)
++ setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
+ if (bind(sock, (struct sockaddr *) &sin, sizeof(struct sockaddr))) {
+ perror("bind");
+ fprintf(stderr, "Couldn't bind to tcp port %d\n", port);
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch
new file mode 100644
index 000000000..6f64dd5b3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch
@@ -0,0 +1,37 @@
+Fix parallel build dependency issue
+
+If building with make -j2 the lib.a will not get built in time.
+
+Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ Config/Makefile.in | 3 +++
+ Makefile.in | 3 ++-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -29,7 +29,8 @@ DESTDIR =
+
+ VPATH = $(srcdir)
+
+-all: subdirs unfsd$(EXEEXT)
++all: subdirs
++ $(MAKE) unfsd$(EXEEXT)
+
+ unfsd$(EXEEXT): $(OBJS) $(CONFOBJ) $(EXTRAOBJ)
+ $(CC) -o $@ $(OBJS) $(CONFOBJ) $(EXTRAOBJ) $(LDFLAGS)
+--- a/Config/Makefile.in
++++ b/Config/Makefile.in
+@@ -16,6 +16,9 @@ lib.a: $(OBJS)
+ $(AR) crs lib.a $(OBJS)
+
+ y.tab.h y.tab.c: $(srcdir)/exports.y
++y.tab.h: y.tab.c
++
++y.tab.c: $(srcdir)/exports.y
+ $(YACC) -d $(srcdir)/exports.y
+
+ y.tab.o: y.tab.c $(srcdir)/exports.h $(top_srcdir)/nfs.h $(top_srcdir)/mount.h $(top_srcdir)/daemon.h
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
new file mode 100644
index 000000000..eba1139e5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Userspace NFS server v3 protocol"
+SECTION = "console/network"
+LICENSE = "unfs3"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=9475885294e17c0cc0067820d042792e"
+
+# SVN support for upstream version check isn't implemented yet
+RECIPE_UPSTREAM_VERSION = "0.9.22.r497"
+RECIPE_UPSTREAM_DATE = "Oct 08, 2015"
+CHECK_DATE = "Dec 10, 2015"
+
+DEPENDS = "flex-native bison-native flex"
+DEPENDS_append_libc-musl = " libtirpc "
+DEPENDS_append_class-nativesdk += "flex-nativesdk"
+
+MOD_PV = "497"
+S = "${WORKDIR}/trunk"
+SRC_URI = "svn://svn.code.sf.net/p/unfs3/code;module=trunk;rev=${MOD_PV};protocol=http \
+ file://unfs3_parallel_build.patch \
+ file://alternate_rpc_ports.patch \
+ file://fix_pid_race_parent_writes_child_pid.patch \
+ file://fix_compile_warning.patch \
+ file://rename_fh_cache.patch \
+ file://relative_max_socket_path_len.patch \
+ file://tcp_no_delay.patch \
+ "
+SRC_URI[md5sum] = "3687acc4ee992e536472365dd99712a7"
+SRC_URI[sha256sum] = "274b43ada9c6eea1da26eb7010d72889c5278984ba0b50dff4e093057d4d64f8"
+
+BBCLASSEXTEND = "native nativesdk"
+
+inherit autotools
+EXTRA_OECONF_append_class-native = " --sbindir=${bindir}"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+
+# Turn off these header detects else the inode search
+# will walk entire file systems and this is a real problem
+# if you have 2 TB of files to walk in your file system
+CACHED_CONFIGUREVARS = "ac_cv_header_mntent_h=no ac_cv_header_sys_mnttab_h=no"
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
new file mode 100644
index 000000000..1d13b9a6b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Selectively remove #ifdef statements from sources"
+SECTION = "devel"
+LICENSE = "BSD-2-Clause"
+HOMEPAGE = "http://dotat.at/prog/unifdef/"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=78fc6c2c1dc4f18c891ed5b7a469fe32 \
+ file://unifdef.c;endline=32;md5=aaec84d8b68d8b6dea71f45e9949ebfe"
+
+SRC_URI = "http://dotat.at/prog/${BPN}/${BP}.tar.xz"
+SRC_URI[md5sum] = "337053fd8a7d9ab3adf5e50f88af95b7"
+SRC_URI[sha256sum] = "828ffc270ac262b88fe011136acef2780c05b0dc3c5435d005651740788d4537"
+
+do_install() {
+ oe_runmake install DESTDIR=${D} prefix=${prefix}
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/vala/vala.inc b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala.inc
new file mode 100644
index 000000000..2a8875f01
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala.inc
@@ -0,0 +1,51 @@
+SUMMARY = "C#-like programming language for easing GObject programming"
+DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \
+Vala compiles to plain C and has no runtime environment nor penalities whatsoever."
+SECTION = "devel"
+DEPENDS = "bison-native flex-native libxslt-native glib-2.0"
+
+# vala-native contains a native version of vapigen, which we use instead of the target one
+DEPENDS_append_class-target = " vala-native"
+BBCLASSEXTEND = "native"
+HOMEPAGE = "http://vala-project.org"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+
+SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
+
+SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz"
+inherit autotools pkgconfig upstream-version-is-even
+
+FILES_${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
+FILES_${PN}-doc += "${datadir}/devhelp"
+
+do_configure_prepend_class-target() {
+ # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot
+ # The wrapper will call a native vapigen
+ cat > ${B}/vapigen-wrapper << EOF
+#!/bin/sh
+vapigen-${SHRT_VER} "\$@"
+EOF
+ chmod +x ${B}/vapigen-wrapper
+}
+
+# Vapigen wrapper needs to be available system-wide, because it will be used
+# to build vapi files from all other packages with vala support
+do_install_append_class-target() {
+ install -d ${D}${bindir}/
+ install ${B}/vapigen-wrapper ${D}${bindir}/
+}
+
+
+SYSROOT_PREPROCESS_FUNCS_append_class-target += "vapigen_sysroot_preprocess"
+
+vapigen_sysroot_preprocess() {
+ # Put vapigen wrapper into target sysroot so that it can be used when building vapi files.
+ sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir}
+
+ # Also, tweak the vapigen name in vapigen pkgconfig file, so that it picks up our
+ # wrapper.
+ sed -i \
+ -e "s|vapigen=.*|vapigen=${bindir}/vapigen-wrapper|" \
+ ${SYSROOT_DESTDIR}${datadir}/pkgconfig/vapigen-${SHRT_VER}.pc
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch
new file mode 100644
index 000000000..ac9dc8c83
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch
@@ -0,0 +1,55 @@
+From 2460d7b79f7e90dcfeebde5e9c53d9b6798a1f3c Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Tue, 21 Feb 2012 17:12:50 +0100
+Subject: [PATCH] git-version-gen: don't append -dirty if we're not in git
+ repo
+
+* for example if we have some dirty directory and we unpack clean vala tarball in it, then it will append -dirty
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Upstream-Status: Inappropriate [OE-Specific]
+---
+ build-aux/git-version-gen | 25 ++++++++++++++-----------
+ 1 files changed, 14 insertions(+), 11 deletions(-)
+
+diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
+index 0fa6faa..1d1f9d2 100755
+--- a/build-aux/git-version-gen
++++ b/build-aux/git-version-gen
+@@ -126,18 +126,21 @@ fi
+
+ v=`echo "$v" |sed 's/^v//'`
+
+-# Don't declare a version "dirty" merely because a time stamp has changed.
+-git status > /dev/null 2>&1
++if test -d .git
++then
++ # Don't declare a version "dirty" merely because a time stamp has changed.
++ git status > /dev/null 2>&1
+
+-dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
+-case "$dirty" in
+- '') ;;
+- *) # Append the suffix only if there isn't one already.
+- case $v in
+- *-dirty) ;;
+- *) v="$v-dirty" ;;
+- esac ;;
+-esac
++ dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
++ case "$dirty" in
++ '') ;;
++ *) # Append the suffix only if there isn't one already.
++ case $v in
++ *-dirty) ;;
++ *) v="$v-dirty" ;;
++ esac ;;
++ esac
++fi
+
+ # Omit the trailing newline, so that m4_esyscmd can use the result directly.
+ echo "$v" | tr -d '\012'
+--
+1.7.8.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch
new file mode 100644
index 000000000..ecab0fc1c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch
@@ -0,0 +1,38 @@
+From dbb1c58e86f2af4613f3ac9571d9b163d4bca675 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 23 Oct 2015 16:13:54 +0300
+Subject: [PATCH] vapigen.m4: use $PKG_CONFIG_SYSROOT_DIR
+
+This is necessary in cross-compiling environments, where directories
+returned by pkg-config should be prefixed with sysroot location.
+
+Upstream-Status: Pending [review in oe-core list]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ vapigen/vapigen.m4 | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/vapigen/vapigen.m4 b/vapigen/vapigen.m4
+index 2c435e7..6228991 100644
+--- a/vapigen/vapigen.m4
++++ b/vapigen/vapigen.m4
+@@ -82,12 +82,12 @@ AC_DEFUN([VAPIGEN_CHECK],
+
+ AS_CASE([$enable_vala],
+ [yes], [
+- VAPIGEN=`$PKG_CONFIG --variable=vapigen $vapigen_pkg_name`
+- VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir $vapigen_pkg_name`/vala/Makefile.vapigen
++ VAPIGEN=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=vapigen $vapigen_pkg_name`
++ VAPIGEN_MAKEFILE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=datadir $vapigen_pkg_name`/vala/Makefile.vapigen
+ AS_IF([test "x$2" = "x"], [
+- VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir $vapigen_pkg_name`
++ VAPIGEN_VAPIDIR=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=vapidir $vapigen_pkg_name`
+ ], [
+- VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned $vapigen_pkg_name`
++ VAPIGEN_VAPIDIR=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=vapidir_versioned $vapigen_pkg_name`
+ ])
+ ])
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.30.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.30.1.bb
new file mode 100644
index 000000000..6394afcc1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/vala/vala_0.30.1.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] = "cc2eb2384fc10038b643753d734a5a51"
+SRC_URI[sha256sum] = "23add78e5c6a5e6df019d4a885c9c79814c9e0b957519ec8a4f4d826c4e5df2c"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch
new file mode 100644
index 000000000..a78e1953f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch
@@ -0,0 +1,51 @@
+From 9762fd23e1f1db66d4b977c694a17d3bca3fe99a Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 8 Jan 2016 16:36:29 +0200
+Subject: [PATCH] Remove tests that fail to build on some PPC32 configurations
+
+Failures are documented here:
+http://errors.yoctoproject.org/Errors/Search/?items=10&query=862d702fbb99e484631315aa44b9e46f8fc567da&filter=valgrind&type=recipe
+
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+Upstream-Status: Pending
+---
+ memcheck/tests/ppc32/Makefile.am | 2 +-
+ none/tests/ppc32/Makefile.am | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/memcheck/tests/ppc32/Makefile.am b/memcheck/tests/ppc32/Makefile.am
+index 26b95a2..8f05743 100644
+--- a/memcheck/tests/ppc32/Makefile.am
++++ b/memcheck/tests/ppc32/Makefile.am
+@@ -10,7 +10,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
+ power_ISA2_07.stderr.exp power_ISA2_07.vgtest
+
+ check_PROGRAMS = \
+- power_ISA2_05 power_ISA2_07
++ power_ISA2_07
+
+ power_ISA2_05_CFLAGS = $(AM_CFLAGS) $(WERROR) -Winline -Wall -Wshadow -g \
+ -I$(top_srcdir)/include @FLAG_M32@
+diff --git a/none/tests/ppc32/Makefile.am b/none/tests/ppc32/Makefile.am
+index 196239e..0fe3425 100644
+--- a/none/tests/ppc32/Makefile.am
++++ b/none/tests/ppc32/Makefile.am
+@@ -50,13 +50,13 @@ EXTRA_DIST = \
+
+ check_PROGRAMS = \
+ allexec \
+- lsw jm-insns round \
++ lsw \
+ test_isa_2_06_part1 test_isa_2_06_part2 test_isa_2_06_part3 \
+ test_dfp1 test_dfp2 test_dfp3 test_dfp4 test_dfp5 \
+ test_isa_2_07_part1 test_isa_2_07_part2 \
+ test_tm test_touch_tm ldst_multiple data-cache-instructions \
+ test_fx test_gx \
+- testVMX twi tw xlc_dbl_u32 power5+_round power6_bcmp \
++ twi tw xlc_dbl_u32 power6_bcmp \
+ bug129390-ppc32 bug139050-ppc32 \
+ ldstrev mftocrf mcrfs
+
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-fix-build-for-musl-targets.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-fix-build-for-musl-targets.patch
new file mode 100644
index 000000000..dc6feff7f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0001-fix-build-for-musl-targets.patch
@@ -0,0 +1,69 @@
+From 1b1a024efd18d44294e184e792c1e039cab02bfe Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 14 Feb 2016 09:14:12 +0000
+Subject: [PATCH] fix build for musl targets
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 2 --
+ coregrind/vg_preloaded.c | 2 +-
+ include/pub_tool_redir.h | 7 +++++--
+ 3 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9366dc7..679f514 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1066,8 +1066,6 @@ case "${GLIBC_VERSION}" in
+ ;;
+ 2.0|2.1|*)
+ AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
+- AC_MSG_ERROR([Valgrind requires glibc version 2.2 or later,])
+- AC_MSG_ERROR([Darwin libc, Bionic libc or Solaris libc])
+ ;;
+ esac
+
+diff --git a/coregrind/vg_preloaded.c b/coregrind/vg_preloaded.c
+index 2ea7a7a..e49c832 100644
+--- a/coregrind/vg_preloaded.c
++++ b/coregrind/vg_preloaded.c
+@@ -56,7 +56,7 @@
+ void VG_NOTIFY_ON_LOAD(freeres)( void );
+ void VG_NOTIFY_ON_LOAD(freeres)( void )
+ {
+-# if !defined(__UCLIBC__) \
++# if !defined(__UCLIBC__) && defined(__GLIBC__) \
+ && !defined(VGPV_arm_linux_android) \
+ && !defined(VGPV_x86_linux_android) \
+ && !defined(VGPV_mips32_linux_android) \
+diff --git a/include/pub_tool_redir.h b/include/pub_tool_redir.h
+index bac00d7..fbb2ef2 100644
+--- a/include/pub_tool_redir.h
++++ b/include/pub_tool_redir.h
+@@ -242,8 +242,7 @@
+ /* --- Soname of the standard C library. --- */
+
+ #if defined(VGO_linux) || defined(VGO_solaris)
+-# define VG_Z_LIBC_SONAME libcZdsoZa // libc.so*
+-
++# define VG_Z_LIBC_SONAME libcZdZa // libc.*
+ #elif defined(VGO_darwin) && (DARWIN_VERS <= DARWIN_10_6)
+ # define VG_Z_LIBC_SONAME libSystemZdZaZddylib // libSystem.*.dylib
+
+@@ -274,7 +273,11 @@
+ /* --- Soname of the pthreads library. --- */
+
+ #if defined(VGO_linux)
++# if defined(__GLIBC__) || defined(__UCLIBC__)
+ # define VG_Z_LIBPTHREAD_SONAME libpthreadZdsoZd0 // libpthread.so.0
++# else
++# define VG_Z_LIBPTHREAD_SONAME libcZdZa // libc.*
++#endif
+ #elif defined(VGO_darwin)
+ # define VG_Z_LIBPTHREAD_SONAME libSystemZdZaZddylib // libSystem.*.dylib
+ #elif defined(VGO_solaris)
+--
+2.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0002-remove-rpath.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0002-remove-rpath.patch
new file mode 100644
index 000000000..e9112da0c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0002-remove-rpath.patch
@@ -0,0 +1,35 @@
+From f96cf1f4eaa72860ab8b5e18ad10fdc704d78c5f Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 15 Dec 2015 15:01:34 +0200
+Subject: [PATCH 2/5] remove rpath
+
+Upstream-Status: Inappropriate [embedded config]
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+---
+ none/tests/Makefile.am | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am
+index 54f2a7e..25b0f49 100644
+--- a/none/tests/Makefile.am
++++ b/none/tests/Makefile.am
+@@ -326,7 +326,6 @@ threadederrno_CFLAGS += --std=c99
+ endif
+ tls_SOURCES = tls.c tls2.c
+ tls_DEPENDENCIES = tls.so tls2.so
+-tls_LDFLAGS = -Wl,-rpath,$(abs_top_builddir)/none/tests
+ tls_LDADD = tls.so tls2.so -lpthread
+ tls_so_SOURCES = tls_so.c
+ tls_so_DEPENDENCIES = tls2.so
+@@ -334,7 +333,7 @@ if VGCONF_OS_IS_DARWIN
+ tls_so_LDFLAGS = -dynamic -dynamiclib -all_load -fpic
+ tls_so_LDADD = `pwd`/tls2.so
+ else
+- tls_so_LDFLAGS = -Wl,-rpath,$(abs_top_builddir)/none/tests -shared -fPIC
++ tls_so_LDFLAGS = -shared -fPIC
+ tls_so_LDADD = tls2.so
+ endif
+ tls_so_CFLAGS = $(AM_CFLAGS) -fPIC
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch
new file mode 100644
index 000000000..ed313d644
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch
@@ -0,0 +1,175 @@
+From 38ae233b6893a4eec7f9ed6d8ad02392bca8eaed Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 15 Dec 2015 15:31:50 +0200
+Subject: [PATCH 1/2] Fix out of tree builds.
+
+The paths to these files need to be fully specified in
+the out of tree build case. glibc-2.X.supp is a generated file so the full path
+is deliberately not specified in that case.
+
+RP 2013/03/23
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ configure.ac | 64 ++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 32 insertions(+), 32 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8ab7f9b..9366dc7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -377,44 +377,44 @@ case "${host_os}" in
+ 9.*)
+ AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin9.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin9-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 10.*)
+ AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 11.*)
+ AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin11.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 12.*)
+ AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin12.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 13.*)
+ AC_MSG_RESULT([Darwin 13.x (${kernel}) / Mac OS X 10.9 Mavericks])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_9, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin13.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin13.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 14.*)
+ AC_MSG_RESULT([Darwin 14.x (${kernel}) / Mac OS X 10.10 Yosemite])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_10, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin14.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin14.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 15.*)
+ AC_MSG_RESULT([Darwin 15.x (${kernel}) / Mac OS X 10.11 El Capitan])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_11, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin15.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin15.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ *)
+ AC_MSG_RESULT([unsupported (${kernel})])
+@@ -426,13 +426,13 @@ case "${host_os}" in
+ solaris2.11*)
+ AC_MSG_RESULT([ok (${host_os})])
+ VGCONF_OS="solaris"
+- DEFAULT_SUPP="solaris11.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/solaris11.supp ${DEFAULT_SUPP}"
+ ;;
+
+ solaris2.12*)
+ AC_MSG_RESULT([ok (${host_os})])
+ VGCONF_OS="solaris"
+- DEFAULT_SUPP="solaris12.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/solaris12.supp ${DEFAULT_SUPP}"
+ ;;
+
+ *)
+@@ -1015,29 +1015,29 @@ AC_MSG_CHECKING([the glibc version])
+ case "${GLIBC_VERSION}" in
+ 2.2)
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+- DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.2.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.[[3-6]])
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+- DEFAULT_SUPP="glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.[[7-9]])
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.10|2.11)
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+ AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
+ [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.*)
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+@@ -1046,8 +1046,8 @@ case "${GLIBC_VERSION}" in
+ AC_DEFINE([GLIBC_MANDATORY_INDEX_AND_STRLEN_REDIRECT], 1,
+ [Define to 1 if index() and strlen() have been optimized heavily (x86 glibc >= 2.12)])
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ darwin)
+ AC_MSG_RESULT(Darwin)
+@@ -1057,7 +1057,7 @@ case "${GLIBC_VERSION}" in
+ bionic)
+ AC_MSG_RESULT(Bionic)
+ AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
+- DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/bionic.supp ${DEFAULT_SUPP}"
+ ;;
+ solaris)
+ AC_MSG_RESULT(Solaris)
+@@ -1079,11 +1079,11 @@ if test "$VGCONF_OS" != "solaris"; then
+ # attempt to detect whether such libraries are installed on the
+ # build machine (or even if any X facilities are present); just
+ # add the suppressions antidisirregardless.
+- DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/xfree-4.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/xfree-3.supp ${DEFAULT_SUPP}"
+
+ # Add glibc and X11 suppressions for exp-sgcheck
+- DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/exp-sgcheck.supp ${DEFAULT_SUPP}"
+ fi
+
+
+--
+2.6.2
+
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
new file mode 100644
index 000000000..f5ac989fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch
@@ -0,0 +1,252 @@
+From f49f27f1bc67d07440b0ac9a7d767a8ea1589bfe Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 15 Dec 2015 15:50:44 +0200
+Subject: [PATCH 5/5] Modify vg_test wrapper to support PTEST formats
+
+Change the valgrind regression test script vg_regtest to
+support the yocto ptest stdout reporting format. The commit adds
+'--yocto-ptest' as an optional argument to vg_regtest, which alters
+the output to use the ptest infrastructure reporting format:
+ "[PASS|SKIP|FAIL]: testname"
+instead of valgrind's internal test reporting format. Without the added
+option, --yocto-ptest, the valgrind regression test output is unchanged.
+
+Enforce 30 seconds limit for the test.
+This resume execution of the remaining tests when valgrind hangs.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ tests/vg_regtest.in | 75 +++++++++++++++++++++++++++++++++++++++--------------
+ 1 file changed, 55 insertions(+), 20 deletions(-)
+
+diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
+index a441f42..cb05b52 100755
+--- a/tests/vg_regtest.in
++++ b/tests/vg_regtest.in
+@@ -47,6 +47,7 @@
+ # --loop-till-fail: loops on the test(s) till one fail, then exit
+ # This is useful to obtain detailed trace or --keep-unfiltered
+ # output of a non deterministic test failure
++# --yocto-ptest: output in yocto ptest format
+ #
+ # The easiest way is to run all tests in valgrind/ with (assuming you installed
+ # in $PREFIX):
+@@ -139,7 +140,7 @@ my $usage="\n"
+ . "Usage:\n"
+ . " vg_regtest [--all, --valgrind, --valgrind-lib, --keep-unfiltered\n"
+ . " --outer-valgrind, --outer-tool, --outer-args\n"
+- . " --loop-till-fail]\n"
++ . " --loop-till-fail, --yocto-ptest]\n"
+ . " Use EXTRA_REGTEST_OPTS to supply extra args for all tests\n"
+ . "\n";
+
+@@ -186,6 +187,7 @@ my $outer_args;
+ my $valgrind_lib = "$tests_dir/.in_place";
+ my $keepunfiltered = 0;
+ my $looptillfail = 0;
++my $yoctoptest = 0;
+
+ # default filter is the one named "filter_stderr" in the test's directory
+ my $default_stderr_filter = "filter_stderr";
+@@ -244,6 +246,8 @@ sub process_command_line()
+ $keepunfiltered = 1;
+ } elsif ($arg =~ /^--loop-till-fail$/) {
+ $looptillfail = 1;
++ } elsif ($arg =~ /^--yocto-ptest$/) {
++ $yoctoptest = 1;
+ } else {
+ die $usage;
+ }
+@@ -365,13 +369,28 @@ sub read_vgtest_file($)
+ #----------------------------------------------------------------------------
+ # Since most of the program time is spent in system() calls, need this to
+ # propagate a Ctrl-C enabling us to quit.
+-sub mysystem($)
++# Enforce 30 seconds limit for the test.
++# This resume execution of the remaining tests if valgrind hangs.
++sub mysystem($)
+ {
+- my $exit_code = system($_[0]);
+- ($exit_code == 2) and exit 1; # 2 is SIGINT
+- return $exit_code;
++ my $exit_code=0;
++ eval {
++ local $SIG{'ALRM'} = sub { die "timed out\n" };
++ alarm(30);
++ $exit_code = system($_[0]);
++ alarm (0);
++ ($exit_code == 2) and die "SIGINT\n"; # 2 is SIGINT
++ };
++ if ($@) {
++ if ($@ eq "timed out\n") {
++ print "timed out\n";
++ return 1;
++ }
++ if ($@ eq "SIGINT\n") {
++ exit 1;
++ }
++ }
+ }
+-
+ # if $keepunfiltered, copies $1 to $1.unfiltered.out
+ # renames $0 tp $1
+ sub filtered_rename($$)
+@@ -419,23 +438,25 @@ sub do_diffs($$$$)
+ # A match; remove .out and any previously created .diff files.
+ unlink("$name.$mid.out");
+ unlink(<$name.$mid.diff*>);
+- return;
++ return 1;
+ }
+ }
+ }
+ # If we reach here, none of the .exp files matched.
+- print "*** $name failed ($mid) ***\n";
++ print "*** $name failed ($mid) ***\n" if ($yoctoptest == 0) ;
+ push(@failures, sprintf("%-40s ($mid)", "$fullname"));
+ $num_failures{$mid}++;
+ if ($looptillfail == 1) {
+ print "Failure encountered, stopping to loop\n";
+ exit 1
+ }
++ return 0;
+ }
+
+ sub do_one_test($$)
+ {
+ my ($dir, $vgtest) = @_;
++ my $diffStatus = 0;
+ $vgtest =~ /^(.*)\.vgtest/;
+ my $name = $1;
+ my $fullname = "$dir/$name";
+@@ -454,7 +475,11 @@ sub do_one_test($$)
+ } elsif (256 == $prereq_res) {
+ # Nb: weird Perl-ism -- exit code of '1' is seen by Perl as 256...
+ # Prereq failed, skip.
+- printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
++ if ($yoctoptest == 0) {
++ printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
++ } else {
++ printf("SKIP: $fullname\n");
++ }
+ return;
+ } else {
+ # Bad prereq; abort.
+@@ -472,7 +497,7 @@ sub do_one_test($$)
+ }
+ # If there is a progB, let's start it in background:
+ printf("%-16s valgrind $extraopts $vgopts $prog $args (progB: $progB $argsB)\n",
+- "$name:");
++ "$name:") if ($yoctoptest == 0);
+ # progB.done used to detect child has finished. See below.
+ # Note: redirection of stdout and stderr is before $progB to allow argsB
+ # to e.g. redirect stdoutB to stderrB
+@@ -488,7 +513,8 @@ sub do_one_test($$)
+ . "touch progB.done) &");
+ }
+ } else {
+- printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:");
++ printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:")
++ if ($yoctoptest == 0);
+ }
+
+ # Collect environment variables, if any.
+@@ -529,7 +555,7 @@ sub do_one_test($$)
+ # Find all the .stdout.exp files. If none, use /dev/null.
+ my @stdout_exps = <$name.stdout.exp*>;
+ @stdout_exps = ( "/dev/null" ) if (0 == scalar @stdout_exps);
+- do_diffs($fullname, $name, "stdout", \@stdout_exps);
++ $diffStatus |= do_diffs($fullname, $name, "stdout", \@stdout_exps);
+
+ # Filter stderr
+ $stderr_filter_args = $name if (! defined $stderr_filter_args);
+@@ -538,7 +564,7 @@ sub do_one_test($$)
+ # Find all the .stderr.exp files. At least one must exist.
+ my @stderr_exps = <$name.stderr.exp*>;
+ (0 != scalar @stderr_exps) or die "Could not find `$name.stderr.exp*'\n";
+- do_diffs($fullname, $name, "stderr", \@stderr_exps);
++ $diffStatus |= do_diffs($fullname, $name, "stderr", \@stderr_exps);
+
+ if (defined $progB) {
+ # wait for the child to be finished
+@@ -562,7 +588,7 @@ sub do_one_test($$)
+ # Find all the .stdoutB.exp files. If none, use /dev/null.
+ my @stdoutB_exps = <$name.stdoutB.exp*>;
+ @stdoutB_exps = ( "/dev/null" ) if (0 == scalar @stdoutB_exps);
+- do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps);
++ $diffStatus |= do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps);
+
+ # Filter stderr
+ $stderrB_filter_args = $name if (! defined $stderrB_filter_args);
+@@ -571,7 +597,7 @@ sub do_one_test($$)
+ # Find all the .stderrB.exp files. At least one must exist.
+ my @stderrB_exps = <$name.stderrB.exp*>;
+ (0 != scalar @stderrB_exps) or die "Could not find `$name.stderrB.exp*'\n";
+- do_diffs($fullname, $name, "stderrB", \@stderrB_exps);
++ $diffStatus |= do_diffs($fullname, $name, "stderrB", \@stderrB_exps);
+ }
+
+ # Maybe do post-test check
+@@ -583,7 +609,7 @@ sub do_one_test($$)
+ # Find all the .post.exp files. If none, use /dev/null.
+ my @post_exps = <$name.post.exp*>;
+ @post_exps = ( "/dev/null" ) if (0 == scalar @post_exps);
+- do_diffs($fullname, $name, "post", \@post_exps);
++ $diffStatus |= do_diffs($fullname, $name, "post", \@post_exps);
+ }
+ }
+
+@@ -592,6 +618,13 @@ sub do_one_test($$)
+ print("(cleanup operation failed: $cleanup)\n");
+ }
+
++ if ($yoctoptest == 1) {
++ if ($diffStatus == 0) {
++ print("PASS: $fullname\n");
++ } else {
++ print("FAIL: $fullname\n");
++ }
++ }
+ $num_tests_done++;
+ }
+
+@@ -631,7 +664,7 @@ sub test_one_dir($$)
+ my $found_tests = (0 != (grep { $_ =~ /\.vgtest$/ } @fs));
+
+ if ($found_tests) {
+- print "-- Running tests in $full_dir $dashes\n";
++ print "-- Running tests in $full_dir $dashes\n" if ($yoctoptest == 0);
+ }
+ foreach my $f (@fs) {
+ if (-d $f) {
+@@ -641,7 +674,7 @@ sub test_one_dir($$)
+ }
+ }
+ if ($found_tests) {
+- print "-- Finished tests in $full_dir $dashes\n";
++ print "-- Finished tests in $full_dir $dashes\n" if ($yoctoptest == 0);
+ }
+
+ chdir("..");
+@@ -667,10 +700,12 @@ sub summarise_results
+ $num_failures{"stdout"}, plural($num_failures{"stdout"}),
+ $num_failures{"stderrB"}, plural($num_failures{"stderrB"}),
+ $num_failures{"stdoutB"}, plural($num_failures{"stdoutB"}),
+- $num_failures{"post"}, plural($num_failures{"post"}));
++ $num_failures{"post"}, plural($num_failures{"post"}))
++ if ($yoctoptest == 0);
+
+ foreach my $failure (@failures) {
+- print "$failure\n";
++ print "$failure\n"
++ if ($yoctoptest == 0);
+ }
+ print "\n";
+ }
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch
new file mode 100644
index 000000000..ecb33b8cb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch
@@ -0,0 +1,37 @@
+Debian fix for MIPS: mmap(0x400000, 32768) failed in UME with error 22 (Invalid argument)
+
+ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777704
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+
+Description: Disable the MIPS linker workarounds when using -Ttext-section
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/777704
+Author: James Cowgill <james410@cowgill.org.uk>
+Last-Update: 2015-04-25
+
+--- a/coregrind/link_tool_exe_linux.in
++++ b/coregrind/link_tool_exe_linux.in
+@@ -76,12 +76,13 @@
+ my $arch = substr($x, 0, index($x, "'"));
+
+ my $extra_args;
+-if (($arch eq 'mips') || ($arch eq 'mipsel')
+- || ($arch eq 'mipsisa32r2el')) {
+- $extra_args = "-static -Wl,--section-start=.reginfo=$ala";
+-} elsif (($arch eq 'mips64') || ($arch eq 'mips64el') ||
+- ($arch eq 'mipsisa64el')) {
+- $extra_args = "-static -Wl,--section-start=.MIPS.options=$ala";
++if ($arch =~ /^mips/ && "@FLAG_T_TEXT@" eq '-Ttext') {
++ # We only need to use the special mips options when using -Ttext
++ if ($arch =~ /^mips(64|isa64)/) {
++ $extra_args = "-static -Wl,--section-start=.MIPS.options=$ala";
++ } else {
++ $extra_args = "-static -Wl,--section-start=.reginfo=$ala";
++ }
+ } else {
+ $extra_args = "-static -Wl,@FLAG_T_TEXT@=$ala";
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch
new file mode 100644
index 000000000..07774f38a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch
@@ -0,0 +1,96 @@
+From 0bf4b0ac18d1ea41b32ad781d214b295ca1998f3 Mon Sep 17 00:00:00 2001
+From: Aneesh Bansal <aneesh.bansal@freescale.com>
+Date: Mon, 21 Nov 2011 17:31:39 +0530
+Subject: [PATCH] Added support for PPC instructions mfatbu, mfatbl.
+
+Upstream-Status: Pending
+
+Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com>
+---
+Currently Valgrind 3.7.0 does not have support for PPC instructions mfatbu and mfatbl. When we run a USDPAA application with VALGRIND, the following error is given by valgrind :
+dis_proc_ctl(ppc)(mfspr,SPR)(0x20F)
+disInstr(ppc): unhandled instruction: 0x7C0F82A6
+
+
+ VEX/priv/guest_ppc_defs.h | 2 ++
+ VEX/priv/guest_ppc_helpers.c | 18 ++++++++++++++++++
+ VEX/priv/guest_ppc_toIR.c | 22 ++++++++++++++++++++++
+ 3 files changed, 42 insertions(+), 0 deletions(-)
+
+diff --git a/VEX/priv/guest_ppc_defs.h b/VEX/priv/guest_ppc_defs.h
+index dd3c62e..11a34aa 100644
+--- a/VEX/priv/guest_ppc_defs.h
++++ b/VEX/priv/guest_ppc_defs.h
+@@ -146,6 +146,8 @@ extern UInt ppc32g_dirtyhelper_MFSPR_268_269 ( UInt );
+
+ extern UInt ppc32g_dirtyhelper_MFSPR_287 ( void );
+
++extern UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt );
++
+ extern void ppc32g_dirtyhelper_LVS ( VexGuestPPC32State* gst,
+ UInt vD_idx, UInt sh,
+ UInt shift_right );
+diff --git a/VEX/priv/guest_ppc_helpers.c b/VEX/priv/guest_ppc_helpers.c
+index 11aa428..b49ea3f 100644
+--- a/VEX/priv/guest_ppc_helpers.c
++++ b/VEX/priv/guest_ppc_helpers.c
+@@ -119,6 +119,24 @@ UInt ppc32g_dirtyhelper_MFSPR_287 ( void )
+ # endif
+ }
+
++/* CALLED FROM GENERATED CODE */
++/* DIRTY HELPER (non-referentially transparent) */
++UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt r527 )
++{
++# if defined(__powerpc__) || defined(_AIX)
++ UInt spr;
++ if (r527) {
++ __asm__ __volatile__("mfspr %0,527" : "=b"(spr));
++ } else {
++ __asm__ __volatile__("mfspr %0,526" : "=b"(spr));
++ }
++ return spr;
++# else
++ return 0;
++# endif
++}
++
++
+
+ /* CALLED FROM GENERATED CODE */
+ /* DIRTY HELPER (reads guest state, writes guest mem) */
+diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c
+index f8d220d..37c8974 100644
+--- a/VEX/priv/guest_ppc_toIR.c
++++ b/VEX/priv/guest_ppc_toIR.c
+@@ -5657,6 +5657,28 @@ static Bool dis_proc_ctl ( VexAbiInfo* vbi, UInt theInstr )
+ break;
+ }
+
++
++ case 526 /* 0x20E */:
++ case 527 /* 0x20F */: {
++ UInt arg = SPR==526 ? 0 : 1;
++ IRTemp val = newTemp(Ity_I32);
++ IRExpr** args = mkIRExprVec_1( mkU32(arg) );
++ IRDirty* d = unsafeIRDirty_1_N(
++ val,
++ 0/*regparms*/,
++ "ppc32g_dirtyhelper_MFSPR_526_527",
++ fnptr_to_fnentry
++ (vbi, &ppc32g_dirtyhelper_MFSPR_526_527),
++ args
++ );
++ /* execute the dirty call, dumping the result in val. */
++ stmt( IRStmt_Dirty(d) );
++ putIReg( rD_addr,
++ mkWidenFrom32(ty, mkexpr(val), False/*unsigned*/) );
++ DIP("mfspr r%u,%u", rD_addr, (UInt)SPR);
++ break;
++ }
++
+ default:
+ vex_printf("dis_proc_ctl(ppc)(mfspr,SPR)(0x%x)\n", SPR);
+ return False;
+--
+1.7.0.4
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch
new file mode 100644
index 000000000..5fcfec001
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch
@@ -0,0 +1,33 @@
+From 8facc29c3c56e6cf9cfef70986cf73876044a3fb Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 19 Jan 2016 16:42:36 -0800
+Subject: [PATCH] avoid neon for targets which don't support it
+
+The sh-mem-random.c test app tries to use neon loads and stores to
+test 64-bit float copies when building for ARM. Allow it to do so if
+possible, but fallback to C when building for ARM targets which don't
+support neon.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ memcheck/tests/sh-mem-random.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/memcheck/tests/sh-mem-random.c b/memcheck/tests/sh-mem-random.c
+index ae82248..816e139 100644
+--- a/memcheck/tests/sh-mem-random.c
++++ b/memcheck/tests/sh-mem-random.c
+@@ -191,7 +191,7 @@ void do_test_at ( U1* arr )
+ "emms"
+ : : "r"(arr+dst), "r"(arr+src) : "memory"
+ );
+-#elif defined(__linux__) && defined(__arm__) && !defined(__aarch64__)
++#elif defined(__linux__) && defined(__arm__) && defined(__ARM_NEON__) && !defined(__aarch64__)
+ /* On arm32, many compilers generate a 64-bit float move
+ using two 32 bit integer registers, which completely
+ defeats this test. Hence force a 64-bit NEON load and
+--
+1.9.1
+
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
new file mode 100644
index 000000000..b054d05f7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch
@@ -0,0 +1,53 @@
+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
+(esp. rpm)
+
+a better fix would need:
+ 1. configure.ac should differentiate PERL and HOSTPERL
+ 2. optionally remove ${STAGING_DIR} in #! line before do_install
+
+8/31/2010 - created by Qing He <qing.he@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in
+index 9dc9565..cc4ef05 100644
+--- a/cachegrind/cg_annotate.in
++++ b/cachegrind/cg_annotate.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+
+ ##--------------------------------------------------------------------##
+ ##--- Cachegrind's annotator. cg_annotate.in ---##
+diff --git a/cachegrind/cg_diff.in b/cachegrind/cg_diff.in
+index 951066e..84c2dde 100644
+--- a/cachegrind/cg_diff.in
++++ b/cachegrind/cg_diff.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+
+ ##--------------------------------------------------------------------##
+ ##--- Cachegrind's differencer. cg_diff.in ---##
+diff --git a/massif/ms_print.in b/massif/ms_print.in
+index e6ffdbf..fb45906 100755
+--- a/massif/ms_print.in
++++ b/massif/ms_print.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+
+ ##--------------------------------------------------------------------##
+ ##--- Massif's results printer ms_print.in ---##
+diff --git a/perf/vg_perf.in b/perf/vg_perf.in
+index 2188a31..83ad024 100644
+--- a/perf/vg_perf.in
++++ b/perf/vg_perf.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+ ##--------------------------------------------------------------------##
+ ##--- Valgrind performance testing script vg_perf ---##
+ ##--------------------------------------------------------------------##
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/run-ptest
new file mode 100755
index 000000000..f9a72ec4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/run-ptest
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# run-ptest - 'ptest' test infrastructure shell script that
+# wraps the valgrind regression script vg_regtest.
+# Must be run in the /usr/lib/valgrind/ptest directory.
+#
+# Dave Lerner <dave.lerner@windriver.com>
+###############################################################
+VALGRINDLIB=@libdir@/valgrind
+tests/vg_regtest --all \
+ --valgrind=/usr/bin/valgrind --valgrind-lib=$VALGRINDLIB \
+ --yocto-ptest
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch
new file mode 100644
index 000000000..adea40521
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch
@@ -0,0 +1,44 @@
+From d134dafc2f11e0d247420a0ba360bcdef77b4093 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 19 Jan 2016 16:00:00 -0800
+Subject: [PATCH] use appropriate -march/-mcpu/-mfpu for ARM test apps
+
+Ensure that test apps in none/tests/arm are compiled with appropriate
+-march/-mcpu/-mfpu flags to support the instructions being tested.
+The aim is to build all tests, even ones which may not run correctly
+on all target CPUs.
+
+For tests requiring armv7ve instructions, ensure that we set both
+-march=armv7ve and -mcpu=cortex-a15 (since some TUNE_CCARGS may set
+-march=armv7-a and adding -mcpu=cortex-a15 alone is not enough to
+over-ride that).
+
+See similar cases in none/tests/arm/Makefile.am
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ none/tests/arm/Makefile.am | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/none/tests/arm/Makefile.am b/none/tests/arm/Makefile.am
+index 4507a20..825290f 100644
+--- a/none/tests/arm/Makefile.am
++++ b/none/tests/arm/Makefile.am
+@@ -62,8 +62,10 @@ neon64_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
+ -mfpu=neon \
+ -mthumb
+
+-intdiv_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a15 -mthumb
++intdiv_CFLAGS = $(AM_CFLAGS) -g -march=armv7ve -mcpu=cortex-a15 -mthumb
+ ldrt_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mthumb
+ ldrt_arm_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -marm
+
+-vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a15 -mfpu=vfpv4 -marm
++vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mfpu=vfpv3
++
++vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -march=armv7ve -mcpu=cortex-a15 -mfpu=vfpv4 -marm
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb
new file mode 100644
index 000000000..51c88bf7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb
@@ -0,0 +1,118 @@
+SUMMARY = "Valgrind memory debugger and instrumentation framework"
+HOMEPAGE = "http://valgrind.org/"
+BUGTRACKER = "http://valgrind.org/support/bug_reports.html"
+LICENSE = "GPLv2 & GPLv2+ & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://include/pub_tool_basics.h;beginline=1;endline=29;md5=ebb8e640ef633f940c425686c873f9fa \
+ file://include/valgrind.h;beginline=1;endline=56;md5=4b5e24908e53016ea561c45f4234a327 \
+ file://COPYING.DOCS;md5=24ea4c7092233849b4394699333b5c56"
+
+X11DEPENDS = "virtual/libx11"
+DEPENDS = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'boost', '', d)} \
+ "
+
+SRC_URI = "http://www.valgrind.org/downloads/valgrind-${PV}.tar.bz2 \
+ file://fixed-perl-path.patch \
+ file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \
+ file://run-ptest \
+ file://11_mips-link-tool.patch \
+ file://0002-remove-rpath.patch \
+ file://0004-Fix-out-of-tree-builds.patch \
+ file://0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch \
+ file://0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch \
+ file://use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch \
+ file://avoid-neon-for-targets-which-don-t-support-it.patch \
+"
+SRC_URI_append_libc-musl = "\
+ file://0001-fix-build-for-musl-targets.patch \
+"
+SRC_URI[md5sum] = "4ea62074da73ae82e0162d6550d3f129"
+SRC_URI[sha256sum] = "6c396271a8c1ddd5a6fb9abe714ea1e8a86fce85b30ab26b4266aeb4c2413b42"
+
+COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64|mips|powerpc|powerpc64).*-linux'
+
+# valgrind supports armv7 and above
+COMPATIBLE_HOST_armv4 = 'null'
+COMPATIBLE_HOST_armv5 = 'null'
+COMPATIBLE_HOST_armv6 = 'null'
+
+inherit autotools ptest
+
+EXTRA_OECONF = "--enable-tls --without-mpicc"
+EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS', True) != '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"
+
+# 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
+# which fixes build path issue in DWARF.
+SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}"
+
+CFLAGS_append_libc-uclibc = " -D__UCLIBC__ "
+
+do_install_append () {
+ install -m 644 ${B}/default.supp ${D}/${libdir}/valgrind/
+}
+
+RDEPENDS_${PN} += "perl"
+
+# valgrind needs debug information for ld.so at runtime in order to
+# redirect functions like strlen.
+RRECOMMENDS_${PN} += "${TCLIBC}-dbg"
+
+RDEPENDS_${PN}-ptest += " sed perl perl-module-file-glob"
+RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils"
+
+# One of the tests contains a bogus interpreter path on purpose, and QA
+# check complains about it
+INSANE_SKIP_${PN}-ptest += "file-rdeps"
+
+do_compile_ptest() {
+ oe_runmake check
+}
+
+do_install_ptest() {
+ chmod +x ${B}/tests/vg_regtest
+
+ # The test application binaries are not automatically installed.
+ # Grab them from the build directory.
+ #
+ # The regression tests require scripts and data files that are not
+ # copied to the build directory. They must be copied from the
+ # source directory.
+ saved_dir=$PWD
+ for parent_dir in ${S} ${B} ; do
+ cd $parent_dir
+
+ # exclude shell or the package won't install
+ rm -rf none/tests/shell* 2>/dev/null
+
+ subdirs="tests cachegrind/tests callgrind/tests drd/tests helgrind/tests massif/tests memcheck/tests none/tests"
+
+ # Get the vg test scripts, filters, and expected files
+ for dir in $subdirs ; do
+ find $dir | cpio -pvdu ${D}${PTEST_PATH}
+ done
+ cd $saved_dir
+ done
+
+ # clean out build artifacts before building the rpm
+ find ${D}${PTEST_PATH} \
+ \( -name "Makefile*" \
+ -o -name "*.o" \
+ -o -name "*.c" \
+ -o -name "*.S" \
+ -o -name "*.h" \) \
+ -exec rm {} \;
+
+ # needed by massif tests
+ cp ${B}/massif/ms_print ${D}${PTEST_PATH}/massif/ms_print
+
+ # handle multilib
+ sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
+}
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/xmlto/files/catalog.xml b/import-layers/yocto-poky/meta/recipes-devtools/xmlto/files/catalog.xml
new file mode 100644
index 000000000..6b8833d87
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/xmlto/files/catalog.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+<delegateSystem systemIdStartString="http://docbook.org/xml/" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//DTD XML Exchange Table Model 19990315" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//DTD CALS Table Model XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//ELEMENTS DocBk XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//DTD DocBook XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//ENTITIES DocBk XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//DTD DocBk XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Normal Walsh//Exchange Table Model 19960430" catalog="./docbook-xml.xml"/>
+<delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model" catalog="./docbook-xml.xml"/>
+<delegateURI uriStartString="http://docbook.sourceforge.net/release/xsl/" catalog="./docbook-xsl.xml"/>
+<delegateSystem systemIdStartString="http://docbook.sourceforge.net/release/xsl/" catalog="./docbook-xsl.xml"/>
+</catalog>
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto-0.0.28/configure.in-drop-the-test-of-xmllint-and-xsltproc.patch b/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto-0.0.28/configure.in-drop-the-test-of-xmllint-and-xsltproc.patch
new file mode 100644
index 000000000..6d547a6c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto-0.0.28/configure.in-drop-the-test-of-xmllint-and-xsltproc.patch
@@ -0,0 +1,30 @@
+configure.in: drop the test of xmllint and xsltproc
+
+The test is unnecessary, the xmllint and xsltproc were explicitly
+added to RDEPENDS.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.in b/configure.in
+--- a/configure.in
++++ b/configure.in
+@@ -42,10 +42,10 @@ AC_ARG_VAR([LOCALE], [Name and path of the `locale' program.])
+ AC_PATH_PROG([LOCALE], [locale], [locale])
+
+ AC_ARG_VAR([XMLLINT], [Name and path of the `xmllint' program.])
+-AC_PATH_PROG([XMLLINT], [xmllint], [xmllint])
++dnl AC_PATH_PROG([XMLLINT], [xmllint], [xmllint])
+
+ AC_ARG_VAR([XSLTPROC], [Name and path of the `xsltproc' program.])
+-AC_PATH_PROG([XSLTPROC], [xsltproc], [xsltproc])
++dnl AC_PATH_PROG([XSLTPROC], [xsltproc], [xsltproc])
+
+ dnl
+ dnl toolchains
+--
+1.8.1.2
+
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
new file mode 100644
index 000000000..71f873f9e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb
@@ -0,0 +1,38 @@
+SUMMARY = "A shell-script tool for converting XML files to various formats"
+HOMEPAGE = "https://fedorahosted.org/xmlto/"
+SECTION = "docs/xmlto"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+SRC_URI = "https://fedorahosted.org/releases/x/m/xmlto/xmlto-${PV}.tar.gz \
+ file://configure.in-drop-the-test-of-xmllint-and-xsltproc.patch \
+ file://catalog.xml \
+"
+SRC_URI[md5sum] = "a1fefad9d83499a15576768f60f847c6"
+SRC_URI[sha256sum] = "2f986b7c9a0e9ac6728147668e776d405465284e13c74d4146c9cbc51fd8aad3"
+
+inherit autotools
+
+# xmlto needs getopt/xmllint/xsltproc/bash at runtime
+RDEPENDS_${PN} = "docbook-xml-dtd4 \
+ docbook-xsl-stylesheets \
+ util-linux \
+ libxml2 \
+ bash \
+"
+RDEPENDS_${PN}_append_class-target = " \
+ libxslt-bin \
+"
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF_append = " BASH=/bin/bash GCP=/bin/cp XMLLINT=xmllint XSLTPROC=xsltproc"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/xml/
+ install -m 755 ${WORKDIR}/catalog.xml ${D}${sysconfdir}/xml/catalog.xml
+ create_wrapper ${D}/${bindir}/xmlto XML_CATALOG_FILES=${sysconfdir}/xml/catalog.xml
+}
+
+do_populate_sysroot[rdeptask] = "do_populate_sysroot"
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
new file mode 100644
index 000000000..78702ed20
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb
@@ -0,0 +1,14 @@
+SUMMARY = "x86 (SSE) assembler supporting NASM and GAS-syntaxes"
+LICENSE = "BSD"
+HOMEPAGE = "http://www.tortall.net/projects/yasm/"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a12d8903508fb6bfd49d8d82c6170dd9"
+
+SRC_URI = "http://www.tortall.net/projects/yasm/releases/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "fc9e586751ff789b34b1f21d572d96af"
+SRC_URI[sha256sum] = "3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f"
+
+inherit autotools gettext
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb b/import-layers/yocto-poky/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb
new file mode 100644
index 000000000..021c05839
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb
@@ -0,0 +1,20 @@
+# zisofs-tools-native OE build file
+# Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+SUMMARY = "Utilities for creating compressed CD-ROM filesystems"
+HOMEPAGE = "http://freecode.com/projects/zisofs-tools"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "zlib-native"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/zisofs-tools/zisofs-tools-${PV}.tar.bz2/2d0ed8c9a1f60b45f949b136f9be1f6c/zisofs-tools-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "2d0ed8c9a1f60b45f949b136f9be1f6c"
+SRC_URI[sha256sum] = "ae4e53e4914934d41660248fb59d3c8761f1f1fd180d5ec993c17ddb3afd04f3"
+
+inherit native
+
+do_install() {
+ oe_runmake install INSTALLROOT=${D} bindir=${bindir}
+}
OpenPOWER on IntegriCloud